diff --git a/Unit_testing/Schema.php b/Unit_testing/Schema.php index cf88bfb..cb921a3 100644 --- a/Unit_testing/Schema.php +++ b/Unit_testing/Schema.php @@ -765,10 +765,16 @@ $this->markAdjustments['incorrectLength'] ); - $this->assertGreaterThanOrEqual( $minLength, $actual->getValue( 0, 'DATA_PRECISION' ), $errorString ); + if ( $minLength > 0 ) + { + $this->assertGreaterThanOrEqual( $minLength, $actual->getValue( 0, 'DATA_PRECISION' ), $errorString ); + } - $this->assertLessThanOrEqual( $maxLength, $actual->getValue( 0, 'DATA_PRECISION' ), $errorString ); - + if ( $maxLength > 0 ) + { + $this->assertLessThanOrEqual( $maxLength, $actual->getValue( 0, 'DATA_PRECISION' ), $errorString ); + } + $this->assertEquals( $numDecimals, $actual->getValue( 0, 'DATA_SCALE' ), $errorString ); } else @@ -787,9 +793,15 @@ $this->markAdjustments['incorrectLength'] ); - $this->assertGreaterThanOrEqual( $minLength, $actual->getValue( 0, 'CHAR_LENGTH' ), $errorString ); + if ( $maxLength > 0 ) + { + $this->assertLessThanOrEqual( $maxLength, $actual->getValue( 0, 'CHAR_LENGTH' ), $errorString ); + } + if ( $minLength > 0 ) + { + $this->assertGreaterThanOrEqual( $minLength, $actual->getValue( 0, 'CHAR_LENGTH' ), $errorString ); + } - $this->assertLessThanOrEqual( $maxLength, $actual->getValue( 0, 'CHAR_LENGTH' ), $errorString ); } } }