First setup: module registry, switchable modules, permissions
This commit is contained in:
commit
936c794597
52 files changed
+1304
No files matched your search
@@ -0,0 +1,34 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user