예제 #1
0
 public function setUp()
 {
     $this->entity = new UsherUser();
     $this->entity->setPermissions(['index' => true, 'show' => false, 'create' => true, 'edit' => false]);
     $this->role = new UsherRole();
     $this->role->setPermissions(['index' => true, 'show' => false, 'create' => false, 'edit' => true, 'destroy' => true]);
     $this->entity->assignRole($this->role);
 }
예제 #2
0
 public function test_can_remove_all_roles()
 {
     $role = new UsherRole();
     $role->setName('Admin');
     $this->entity->assignRole($role);
     $this->assertCount(1, $this->entity->getRoles());
     $this->entity->removeAllRoles();
     $this->assertCount(0, $this->entity->getRoles());
 }