@@ -430,4 +430,42 @@ public function testEnabledBefore()
430
430
$ this ->assertDatabaseMigrationHas ($ this ->table , 'test_before_enabled ' );
431
431
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'test_before_disabled ' );
432
432
}
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
+ }
433
471
}
0 commit comments