diff --git a/src/Models/Type.php b/src/Models/Type.php index 4017458..2a9de10 100644 --- a/src/Models/Type.php +++ b/src/Models/Type.php @@ -2,8 +2,8 @@ namespace dnj\AAA\Models; -use dnj\AAA\Contracts\ITypeManager; use dnj\AAA\Contracts\IType; +use dnj\AAA\Contracts\ITypeManager; use dnj\AAA\Contracts\IUser; use dnj\AAA\Database\Factories\TypeFactory; use dnj\AAA\Models\Concerns\HasAbilities; diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 02fde8a..64443e1 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -37,6 +37,7 @@ public function boot() $this->integrateToGates(); $this->registerRoutes(); $this->registerPublishing(); + $this->registerPolicies(); } /** diff --git a/tests/TestCase.php b/tests/TestCase.php index f8da5c1..d7e7455 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -10,8 +10,10 @@ use dnj\AAA\Models\TypeTranslate; use dnj\AAA\Models\User; use dnj\AAA\Policy; +use dnj\AAA\ServiceProvider as AAAServiceProvider; use dnj\AAA\TypeManager; use dnj\AAA\UserManager; +use dnj\UserLogger\ServiceProvider as UserLoggerServiceProvider; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\App; use Orchestra\Testbench\Concerns\WithWorkbench; @@ -41,8 +43,21 @@ protected function createUserWithAbility(string $ability): IUser return User::factory()->withType($myType)->create(); } + protected function defineDatabaseMigrations(): void + { + $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); + } + protected function createUserWithModelAbility(string $model, string $ability): IUser { return $this->createUserWithAbility(Policy::getModelAbilityName($model, $ability)); } + + protected function getPackageProviders($app) + { + return [ + AAAServiceProvider::class, + UserLoggerServiceProvider::class, + ]; + } }