From c5cd044e3d54b87d79283cf0cc065240d90979f0 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 e96106ba6..14ca53ed2 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);