diff --git a/tests/MigrationTestCase.php b/tests/MigrationTestCase.php index e96106ba..14ca53ed 100644 --- a/tests/MigrationTestCase.php +++ b/tests/MigrationTestCase.php @@ -32,12 +32,14 @@ */ class Doctrine_Migration_TestCase extends Doctrine_UnitTestCase { - protected $tables = array( + const TABLES = array( 'MigrationPhonenumber', 'MigrationUser', 'MigrationProfile', ); + protected $tables = self::TABLES; + public function testMigration() { $migration = new Doctrine_Migration('migration_classes'); @@ -128,14 +130,8 @@ public function testMigrationClassNameInflected() public function test_afterSuccessfullMigration_willSetMigratedVersionAsCurrentVersionInMysqlDB() { - $tables = array( - 'MigrationPhonenumber', - 'MigrationUser', - 'MigrationProfile', - ); - $connection = $this->openMysqlAdditionalConnection(); - $this->resetTablesOnConnection($tables, $connection); + $this->resetTablesOnConnection(self::TABLES, $connection); $migration = new Doctrine_Migration('migration_classes', $connection); $migration->setCurrentVersion(3); @@ -146,14 +142,8 @@ public function test_afterSuccessfullMigration_willSetMigratedVersionAsCurrentVe public function test_afterFailedMigration_willKeepCurrentVersionInMysqlDB() { - $tables = array( - 'MigrationPhonenumber', - 'MigrationUser', - 'MigrationProfile', - ); - $connection = $this->openMysqlAdditionalConnection(); - $this->resetTablesOnConnection($tables, $connection); + $this->resetTablesOnConnection(self::TABLES, $connection); $migration = new Doctrine_Migration('migration_classes', $connection); $migration->setCurrentVersion(0);