Neos\Flow\Tests\Unit\Security\ContextTest::getAccountByAuthenticationProviderNameReturnsNullIfNoAccountFound PHP Method

getAccountByAuthenticationProviderNameReturnsNullIfNoAccountFound() public method

    public function getAccountByAuthenticationProviderNameReturnsNullIfNoAccountFound()
    {
        $mockAuthenticationManager = $this->createMock(AuthenticationManagerInterface::class);
        /** @var Context $securityContext */
        $securityContext = $this->getAccessibleMock(Context::class, ['getAuthenticationTokens']);
        $securityContext->setRequest($this->mockActionRequest);
        $securityContext->_set('authenticationManager', $mockAuthenticationManager);
        $securityContext->_set('activeTokens', []);
        $this->assertSame(null, $securityContext->getAccountByAuthenticationProviderName('UnknownProvider'));
    }
ContextTest