File tree Expand file tree Collapse file tree 2 files changed +14
-20
lines changed
Expand file tree Collapse file tree 2 files changed +14
-20
lines changed Original file line number Diff line number Diff line change 55namespace Tests \Unit \Database ;
66
77use Illuminate \Foundation \Testing \RefreshDatabase ;
8- use Illuminate \ Support \ Facades \ Artisan ;
8+ use Tests \ TestCase ;
99
10- class MigrationTest extends \ Tests \ TestCase
10+ class MigrationTest extends TestCase
1111{
1212 use RefreshDatabase;
1313
1414 public function test_fresh_migration_and_rollback_runs_successfully (): void
1515 {
16- Artisan::call ('migrate:fresh ' );
17- Artisan::call ('migrate:rollback ' );
18- $ this ->assertTrue (true );
19- }
20-
21- public function testFreshMigrationWithSeederAndRollbackRunsSuccessfully (): void
22- {
23- Artisan::call ('migrate:fresh --seed ' );
24- Artisan::call ('migrate:rollback ' );
25- $ this ->assertTrue (true );
16+ $ this ->artisan ('migrate:rollback ' )
17+ ->assertSuccessful ();
2618 }
2719}
Original file line number Diff line number Diff line change 55namespace Tests \Unit \Database ;
66
77use Illuminate \Foundation \Testing \RefreshDatabase ;
8- use Illuminate \ Support \ Facades \ Artisan ;
8+ use Tests \ TestCase ;
99
10- class SeederTest extends \ Tests \ TestCase
10+ class SeederTest extends TestCase
1111{
1212 use RefreshDatabase;
1313
1414 public function test_running_the_seeder_multiple_times_runs_successfully (): void
1515 {
16- Artisan::call ('db:seed ' );
17- Artisan::call ('db:seed ' );
18- $ this ->assertTrue (true );
16+ $ this ->artisan ('db:seed ' )
17+ ->assertSuccessful ();
18+ $ this ->artisan ('db:seed ' )
19+ ->assertSuccessful ();
1920 }
2021
2122 public function test_fresh_migration_with_seeder_and_rollback_runs_successfully (): void
2223 {
23- Artisan::call ('migrate:fresh --seed ' );
24- Artisan::call ('migrate:rollback ' );
25- $ this ->assertTrue (true );
24+ $ this ->artisan ('db:seed ' )
25+ ->assertSuccessful ();
26+ $ this ->artisan ('migrate:rollback ' )
27+ ->assertSuccessful ();
2628 }
2729}
You can’t perform that action at this time.
0 commit comments