MINOR Revert changes for 5.4

This commit is contained in:
Sean Harvey 2012-05-10 14:11:33 +12:00
parent f30a3bd760
commit 56e75b4486
2 changed files with 5 additions and 4 deletions

View File

@ -230,7 +230,7 @@ abstract class SS_Database {
* Returns true if schema modifications were requested after a beginSchemaUpdate() call. * Returns true if schema modifications were requested after a beginSchemaUpdate() call.
*/ */
function doesSchemaNeedUpdating() { function doesSchemaNeedUpdating() {
return ($this->schemaUpdateTransaction === null) ? false : true; return (bool)$this->schemaUpdateTransaction;
} }
// Transactional schema altering functions - they don't do anyhting except for update schemaUpdateTransaction // Transactional schema altering functions - they don't do anyhting except for update schemaUpdateTransaction

View File

@ -35,9 +35,10 @@ class MySQLDatabaseTest extends SapphireTest {
$db->beginSchemaUpdate(); $db->beginSchemaUpdate();
$obj = new MySQLDatabaseTest_DO(); $obj = new MySQLDatabaseTest_DO();
$obj->requireTable(); $obj->requireTable();
$this->assertTrue($db->doesSchemaNeedUpdating()); $needsUpdating = $db->doesSchemaNeedUpdating();
$db->cancelSchemaUpdate(); $db->cancelSchemaUpdate();
$this->assertFalse($db->doesSchemaNeedUpdating());
$this->assertFalse($needsUpdating);
} }
} }
} }