Neos\Flow\Tests\Unit\Security\ContextTest::hasRoleReturnsFalseForAnonymousRoleIfAuthenticated PHP Метод

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

    public function hasRoleReturnsFalseForAnonymousRoleIfAuthenticated()
    {
        $mockAuthenticationManager = $this->createMock(AuthenticationManagerInterface::class);
        $mockAuthenticationManager->expects($this->any())->method('isAuthenticated')->will($this->returnValue(true));
        $securityContext = $this->getAccessibleMock(Context::class, ['initialize']);
        $securityContext->_set('authenticationManager', $mockAuthenticationManager);
        $this->assertFalse($securityContext->hasRole('Neos.Flow:Anonymous'));
    }
ContextTest