Skip to content

Commit

Permalink
fixup! fix: Database Migration does set current version in DB Friends…
Browse files Browse the repository at this point in the history
  • Loading branch information
alquerci committed Jul 3, 2024
1 parent 3d88ef7 commit 18f8d35
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions tests/MigrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 18f8d35

Please sign in to comment.