vd/app/Domains/Permission/Tests/Services/RoleServiceTest.php
2018-11-05 09:26:30 +08:00

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'));
}
}