Ejemplo n.º 1
0
 /**
  * Get the permission with the given name.
  *
  * @param string $permissionName
  *
  * @return \Artesaos\Defender\Permission|null
  */
 public function findPermission($permissionName)
 {
     return $this->permissionRepository->findByName($permissionName);
 }
Ejemplo n.º 2
0
 public function it_should_return_true_when_the_given_permission_exists(PermissionRepository $permissionRepository, $permission)
 {
     $permission->beADoubleOf('Artesaos\\Defender\\Permission');
     $permissionRepository->findByName('foo')->shouldBeCalled()->willReturn($permission);
     $this->permissionExists('foo')->shouldReturn(true);
 }