generated from worksome/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
23 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Worksome\MultiFactorAuth\Tests; | ||
|
||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
use Illuminate\Contracts\Config\Repository as ConfigRepository; | ||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
use Orchestra\Testbench\TestCase as Orchestra; | ||
use Worksome\MultiFactorAuth\MultiFactorAuthServiceProvider; | ||
|
||
class TestCase extends Orchestra | ||
abstract class TestCase extends Orchestra | ||
{ | ||
use RefreshDatabase; | ||
|
||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
Factory::guessFactoryNamesUsing( | ||
fn( | ||
string $modelName, | ||
) => 'Worksome\\TwoFactorAuth\\Database\\Factories\\' . class_basename($modelName) . 'Factory' | ||
); | ||
} | ||
|
||
protected function getPackageProviders($app): array | ||
{ | ||
return [ | ||
MultiFactorAuthServiceProvider::class, | ||
]; | ||
} | ||
|
||
public function defineEnvironment($app) | ||
{ | ||
config()->set('database.default', 'testing'); | ||
} | ||
|
||
protected function defineDatabaseMigrations() | ||
/** {@inheritdoc} */ | ||
public function defineEnvironment($app): void | ||
{ | ||
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations/create_mfa_multi_factors_table.php'); | ||
$app->make(ConfigRepository::class)->set('database.default', 'testing'); | ||
} | ||
} |