/** * Get the permission with the given name. * * @param string $permissionName * * @return \Artesaos\Defender\Permission|null */ public function findPermission($permissionName) { return $this->permissionRepository->findByName($permissionName); }
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); }