From 3e3b53750e198167556a2d8dc1691361f2fe8fa2 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 6 Jun 2024 10:11:34 -0400 Subject: [PATCH] Fix failing test in CI --- tests/TestCase/Command/RollbackCommandTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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());