26 lines
636 B
PHP
26 lines
636 B
PHP
<?php
|
|
namespace App\Domains\Permission\Tests\Services;
|
|
|
|
use App\Models\Account\Account;
|
|
use App\Models\Permission\Role;
|
|
use Dipper\Foundation\Core\TestCase;
|
|
use App\Domains\Permission\Services\RoleService;
|
|
|
|
class RoleServiceTest extends TestCase
|
|
{
|
|
public function testRoleService()
|
|
{
|
|
$root = Account::where('username', 'root')->first();
|
|
|
|
app('dipper')->setAccount($root);
|
|
|
|
$roleService = app(RoleService::class);
|
|
|
|
$roles = $roleService->index();
|
|
|
|
$this->assertNotEmpty($roles['type']);
|
|
|
|
$this->assertTrue($root->hasPermissionTo('api.permissions.create'));
|
|
}
|
|
}
|