Skip to content

Commit 152db2e

Browse files
committed
fix(tests): missing default auth guard
1 parent 4716556 commit 152db2e

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tests/TestCase.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected function setUp(): void
1414
{
1515
parent::setUp();
1616

17-
$this->withFactories(__DIR__.'/Fixtures/database/factories');
17+
$this->withFactories(__DIR__ . '/Fixtures/database/factories');
1818
}
1919

2020
/**
@@ -24,7 +24,7 @@ protected function setUp(): void
2424
*/
2525
protected function refreshInMemoryDatabase()
2626
{
27-
$this->artisan('migrate', ['--path' => __DIR__.'/Fixtures/database/migrations', '--realpath' => true]);
27+
$this->artisan('migrate', ['--path' => __DIR__ . '/Fixtures/database/migrations', '--realpath' => true]);
2828

2929
$this->app[Kernel::class]->setArtisan(null);
3030
}
@@ -37,7 +37,7 @@ protected function refreshInMemoryDatabase()
3737
protected function refreshTestDatabase()
3838
{
3939
if (!RefreshDatabaseState::$migrated) {
40-
$this->artisan('migrate', ['--path' => __DIR__.'/Fixtures/database/migrations', '--realpath' => true]);
40+
$this->artisan('migrate', ['--path' => __DIR__ . '/Fixtures/database/migrations', '--realpath' => true]);
4141

4242
$this->app[Kernel::class]->setArtisan(null);
4343

@@ -50,7 +50,15 @@ protected function refreshTestDatabase()
5050
protected function getPackageProviders($app)
5151
{
5252
return [
53-
'Orion\Tests\Fixtures\App\Providers\OrionServiceProvider'
53+
'Orion\Tests\Fixtures\App\Providers\OrionServiceProvider',
5454
];
5555
}
56+
57+
protected function getEnvironmentSetUp($app)
58+
{
59+
$app['config']->set('auth.guards.api', [
60+
'driver' => 'token',
61+
'provider' => 'users',
62+
]);
63+
}
5664
}

0 commit comments

Comments
 (0)