35 lines
1014 B
PHP
35 lines
1014 B
PHP
<?php
|
|
|
|
namespace IriksIT\Manager\Tests;
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use IriksIT\Manager\ManagerServiceProvider;
|
|
use IriksIT\Manager\Tests\Fixtures\User;
|
|
use Orchestra\Testbench\TestCase as Orchestra;
|
|
|
|
abstract class TestCase extends Orchestra
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
/** @var array<string, bool> */
|
|
protected array $modules = [];
|
|
|
|
protected function getPackageProviders($app): array
|
|
{
|
|
return [ManagerServiceProvider::class];
|
|
}
|
|
|
|
protected function defineEnvironment($app): void
|
|
{
|
|
$app['config']->set('database.default', 'testing');
|
|
$app['config']->set('app.key', 'base64:'.base64_encode(str_repeat('a', 32)));
|
|
$app['config']->set('manager.user_model', User::class);
|
|
$app['config']->set('manager.modules', array_merge($app['config']->get('manager.modules'), $this->modules));
|
|
}
|
|
|
|
protected function defineDatabaseMigrations(): void
|
|
{
|
|
$this->loadMigrationsFrom(__DIR__.'/Fixtures/migrations');
|
|
}
|
|
}
|