Skip to content

Commit

Permalink
Add test for #722
Browse files Browse the repository at this point in the history
I wasn't able to reproduce this issue in the test suite.
  • Loading branch information
markstory committed Jun 6, 2024
1 parent 266c086 commit fab711c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/TestCase/Command/RollbackCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,28 @@ public function testTargetOption(): void
$this->assertFileDoesNotExist($dumpFile);
}

public function testPluginOption(): void
{
$this->loadPlugins(['Migrator']);
$this->exec('migrations migrate -c test --plugin Migrator --no-lock');
$this->assertExitSuccess();

// migration state was recorded.
$phinxlog = $this->fetchTable('MigratorPhinxlog');
$this->assertEquals(1, $phinxlog->find()->count());
// Table was created.
$this->assertNotEmpty($this->fetchTable('Migrator')->getSchema());

$this->resetOutput();

$this->exec('migrations rollback -c test --plugin Migrator --no-lock');
$this->assertExitSuccess();

$this->assertOutputContains('Migrator:</info> <comment>reverted');
// No more recorded migrations
$this->assertEquals(0, $phinxlog->find()->count());
}

public function testLockOption(): void
{
$migrationPath = ROOT . DS . 'config' . DS . 'Migrations';
Expand Down

0 comments on commit fab711c

Please sign in to comment.