diff --git a/tests/TestCase/Command/RollbackCommandTest.php b/tests/TestCase/Command/RollbackCommandTest.php index 1468533c..e6b0e4fc 100644 --- a/tests/TestCase/Command/RollbackCommandTest.php +++ b/tests/TestCase/Command/RollbackCommandTest.php @@ -6,6 +6,7 @@ use Cake\Console\TestSuite\ConsoleIntegrationTestTrait; use Cake\Core\Configure; use Cake\Database\Exception\DatabaseException; +use Cake\Datasource\ConnectionManager; use Cake\Event\EventInterface; use Cake\Event\EventManager; use Cake\TestSuite\TestCase; @@ -202,12 +203,15 @@ public function testTargetOption(): void public function testPluginOption(): void { $this->loadPlugins(['Migrator']); + $connection = ConnectionManager::get('test'); + $connection->execute('DROP TABLE IF EXISTS 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()); + $this->assertEquals(1, $phinxlog->find()->count(), 'migrate makes a row'); // Table was created. $this->assertNotEmpty($this->fetchTable('Migrator')->getSchema());