Ensured that maximum and minimum column length assertions are only asserted where actually relevant.
1 parent eebe41b commit 3ac0f1255be1efc1b6fe5d39e3c7e69e879cef25
Nigel Stanger authored on 25 Jun 2013
Showing 1 changed file
View
42
Unit_testing/Schema.php
$actual->getValue( 0, 'DATA_SCALE' ),
$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
{
$actual->getValue( 0, 'CHAR_LENGTH' ),
$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 );
}
}
}
}
}
}
/**
* Assert that a column allows or disallows nulls.