@@ -26,8 +26,7 @@ public function test_migrate_fresh_command(): void
2626
2727 $ this ->console
2828 ->call (MigrateFreshCommand::class)
29- ->assertContains ('DROPPING ' )
30- ->assertNotSee ('There is no migration to drop ' )
29+ ->assertContains ('MIGRATED ' )
3130 ->assertSuccess ();
3231
3332 Assert::assertNotEmpty (Migration::all ());
@@ -46,7 +45,6 @@ public function test_migrate_fresh_command_fails_with_validate_when_migrations_a
4645 {
4746 $ this ->console
4847 ->call (MigrateFreshCommand::class)
49- ->assertContains ('Migration files are valid ' )
5048 ->assertExitCode (ExitCode::SUCCESS );
5149
5250 $ migrations = Migration::all ();
@@ -56,25 +54,29 @@ public function test_migrate_fresh_command_fails_with_validate_when_migrations_a
5654 }
5755
5856 $ this ->console
59- ->call (MigrateFreshCommand::class)
57+ ->call (MigrateFreshCommand::class, [ ' --validate ' ] )
6058 ->assertExitCode (ExitCode::INVALID );
6159 }
6260
63- public function test_migrate_fresh_command_skips_validation_and_runs_if_specified (): void
61+ public function test_migrate_fresh_command_skips_validation_by_default (): void
6462 {
6563 $ this ->console
6664 ->call (MigrateFreshCommand::class)
67- ->assertContains ('Migration files are valid ' )
6865 ->assertExitCode (ExitCode::SUCCESS );
6966
7067 $ migrations = Migration::all ();
68+
7169 foreach ($ migrations as $ migration ) {
7270 $ migration ->hash = 'invalid-hash ' ;
7371 $ migration ->save ();
7472 }
7573
7674 $ this ->console
77- ->call ('migrate:fresh --no-validate ' )
75+ ->call ('migrate:fresh --validate ' )
76+ ->assertExitCode (ExitCode::INVALID );
77+
78+ $ this ->console
79+ ->call ('migrate:fresh ' )
7880 ->assertExitCode (ExitCode::SUCCESS );
7981 }
8082}
0 commit comments