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

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

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