Skip to content

Commit 62ac23c

Browse files
committed
Fixed tests after adding schema dumps for test database
1 parent c0c678a commit 62ac23c

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

tests/Unit/Database/MigrationTest.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,15 @@
55
namespace Tests\Unit\Database;
66

77
use 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
}

tests/Unit/Database/SeederTest.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,25 @@
55
namespace Tests\Unit\Database;
66

77
use 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
}

0 commit comments

Comments
 (0)