Skip to content

Commit a6bd4da

Browse files
committed
test: fix tests that depends on table state
1 parent 99c6d94 commit a6bd4da

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

tests/_support/MigrationTestMigrations/Database/Migrations/2018-01-24-102301_Some_migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function up()
2121
'constraint' => 255,
2222
],
2323
]);
24-
$this->forge->createTable('foo', true);
24+
$this->forge->createTable('foo');
2525

2626
$this->db->table('foo')->insert([
2727
'key' => 'foobar',

tests/system/Database/Migrations/MigrationRunnerTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ public function testLatestSuccess()
349349

350350
public function testRegressSuccess()
351351
{
352+
$forge = Database::forge();
353+
$forge->dropTable('foo', true);
354+
352355
$runner = new MigrationRunner($this->config);
353356
$runner->setSilent(false)
354357
->setNamespace('Tests\Support\MigrationTestMigrations')
@@ -368,6 +371,9 @@ public function testRegressSuccess()
368371

369372
public function testLatestTriggersEvent()
370373
{
374+
$forge = Database::forge();
375+
$forge->dropTable('foo', true);
376+
371377
$runner = new MigrationRunner($this->config);
372378
$runner->setSilent(false)
373379
->setNamespace('Tests\Support\MigrationTestMigrations');
@@ -387,6 +393,9 @@ public function testLatestTriggersEvent()
387393

388394
public function testRegressTriggersEvent()
389395
{
396+
$forge = Database::forge();
397+
$forge->dropTable('foo', true);
398+
390399
$runner = new MigrationRunner($this->config);
391400
$runner->setSilent(false)
392401
->setNamespace('Tests\Support\MigrationTestMigrations');

0 commit comments

Comments
 (0)