Skip to content

Commit 80c8f6d

Browse files
Added mixed test
1 parent 9d936a1 commit 80c8f6d

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/Commands/MigrateTest.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,4 +430,42 @@ public function testEnabledBefore()
430430
$this->assertDatabaseMigrationHas($this->table, 'test_before_enabled');
431431
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_disabled');
432432
}
433+
434+
public function testMixedBefore()
435+
{
436+
$this->copyFiles();
437+
438+
$table = 'before';
439+
440+
$this->artisan('migrate:actions:install')->run();
441+
442+
$this->assertDatabaseCount($table, 0);
443+
$this->assertDatabaseCount($this->table, 0);
444+
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_enabled');
445+
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_disabled');
446+
$this->artisan('migrate:actions', ['--before' => true])->run();
447+
448+
$this->assertDatabaseCount($table, 1);
449+
$this->assertDatabaseCount($this->table, 9);
450+
$this->assertDatabaseMigrationHas($this->table, 'test_before_enabled');
451+
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_disabled');
452+
$this->artisan('migrate:actions', ['--before' => true])->run();
453+
454+
$this->assertDatabaseCount($table, 1);
455+
$this->assertDatabaseCount($this->table, 9);
456+
$this->assertDatabaseMigrationHas($this->table, 'test_before_enabled');
457+
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_disabled');
458+
$this->artisan('migrate:actions')->run();
459+
460+
$this->assertDatabaseCount($table, 2);
461+
$this->assertDatabaseCount($this->table, 10);
462+
$this->assertDatabaseMigrationHas($this->table, 'test_before_enabled');
463+
$this->assertDatabaseMigrationHas($this->table, 'test_before_disabled');
464+
$this->artisan('migrate:actions')->run();
465+
466+
$this->assertDatabaseCount($table, 2);
467+
$this->assertDatabaseCount($this->table, 10);
468+
$this->assertDatabaseMigrationHas($this->table, 'test_before_enabled');
469+
$this->assertDatabaseMigrationHas($this->table, 'test_before_disabled');
470+
}
433471
}

0 commit comments

Comments
 (0)