public function test_unset_a_suspend()
 {
     $this->entity->suspend();
     $this->assertTrue($this->entity->isSuspended());
     $this->entity->unsetSuspended();
     $this->assertFalse($this->entity->isSuspended());
 }
Exemple #2
0
 public function test_unset_a_ban()
 {
     $this->entity->ban();
     $this->assertTrue($this->entity->isBanned());
     $this->entity->unsetBan();
     $this->assertFalse($this->entity->isBanned());
 }
Exemple #3
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());
 }
Exemple #4
0
 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());
 }
Exemple #6
0
 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'));
 }