public function test_unset_a_suspend() { $this->entity->suspend(); $this->assertTrue($this->entity->isSuspended()); $this->entity->unsetSuspended(); $this->assertFalse($this->entity->isSuspended()); }
public function test_unset_a_ban() { $this->entity->ban(); $this->assertTrue($this->entity->isBanned()); $this->entity->unsetBan(); $this->assertFalse($this->entity->isBanned()); }
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()); }
public function test_can_check_if_has_access() { $this->entity->setPermissions(['dashboard.index' => true, 'dashboard.show' => false]); $this->assertTrue($this->entity->hasAccess('dashboard.index')); $this->assertFalse($this->entity->hasAccess('dashboard.show')); }
public function test_can_set_updated_at() { $date = Carbon::now(); $this->entity->setUpdatedAt(new UpdatedAt($date)); $this->assertEquals($date, $this->entity->getUpdatedAt()->getDate()); }
public function test_cannot_activate_with_invalid_code() { $this->setExpectedException('Maatwebsite\\Usher\\Exceptions\\InvalidActiviationCodeException'); $this->entity->activate(new ActivationCode('wrong')); }
public function test_deny_access_when_permission_does_not_exist() { $this->assertFalse($this->entity->hasAccess('non-existing')); $this->assertFalse($this->role->hasAccess('non-existing')); }