Neos\Flow\Tests\Unit\Security\Authorization\PrivilegeManagerTest::isGrantedGrantsIfNoPrivilegeWasConfigured PHP Method

isGrantedGrantsIfNoPrivilegeWasConfigured() public method

    public function isGrantedGrantsIfNoPrivilegeWasConfigured()
    {
        $role1ClassName = 'role1' . md5(uniqid(mt_rand(), true));
        $role2ClassName = 'role2' . md5(uniqid(mt_rand(), true));
        $mockRoleAdministrator = $this->createMock(Security\Policy\Role::class, [], [], $role1ClassName, false);
        $mockRoleAdministrator->expects($this->any())->method('getPrivilegesByType')->will($this->returnValue([]));
        $mockRoleCustomer = $this->createMock(Security\Policy\Role::class, [], [], $role2ClassName, false);
        $mockRoleCustomer->expects($this->any())->method('getPrivilegesByType')->will($this->returnValue([]));
        $this->mockSecurityContext->expects($this->once())->method('getRoles')->will($this->returnValue([$mockRoleAdministrator, $mockRoleCustomer]));
        $this->assertTrue($this->privilegeManager->isGranted(MethodPrivilegeInterface::class, $this->mockJoinPoint));
    }