ZfcRbac\Service\RoleService::setGuestRole PHP Метод

setGuestRole() публичный Метод

Set the guest role
public setGuestRole ( string $guestRole ) : void
$guestRole string
Результат void
    public function setGuestRole($guestRole)
    {
        $this->guestRole = (string) $guestRole;
    }

Usage Example

Пример #1
0
 public function testReturnGuestRoleIfNoIdentityIsFound()
 {
     $identityProvider = $this->getMock('ZfcRbac\\Identity\\IdentityProviderInterface');
     $identityProvider->expects($this->any())->method('getIdentity')->will($this->returnValue(null));
     $roleService = new RoleService($identityProvider, new InMemoryRoleProvider([]), $this->getMock('Rbac\\Traversal\\Strategy\\TraversalStrategyInterface'));
     $roleService->setGuestRole('guest');
     $result = $roleService->getIdentityRoles();
     $this->assertEquals('guest', $roleService->getGuestRole());
     $this->assertCount(1, $result);
     $this->assertInstanceOf('Rbac\\Role\\RoleInterface', $result[0]);
     $this->assertEquals('guest', $result[0]->getName());
 }
All Usage Examples Of ZfcRbac\Service\RoleService::setGuestRole