From e535e02a2a6a3a81da0d4cd529182e910ce97c5e Mon Sep 17 00:00:00 2001 From: Alexandre Quercia Date: Sat, 13 Apr 2024 17:45:18 +0200 Subject: [PATCH] fixup! fix: Database Migration does set current version in DB #98 --- tests/MigrationTestCase.php | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) 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);