Neos\Flow\Tests\Unit\Security\Authentication\Token\UsernamePasswordHttpBasicTest::credentialsAreSetCorrectlyForCGI PHP Method

credentialsAreSetCorrectlyForCGI() public method

    public function credentialsAreSetCorrectlyForCGI()
    {
        $expectedCredentials = ['username' => 'robert', 'password' => 'mysecretpassword, containing a : colon ;-)'];
        $serverEnvironment = ['REDIRECT_REMOTE_AUTHORIZATION' => 'Basic ' . base64_encode($expectedCredentials['username'] . ':' . $expectedCredentials['password'])];
        $httpRequest = Request::create(new Uri('http://foo.com'), 'GET', [], [], $serverEnvironment);
        $mockActionRequest = $this->getMockBuilder(ActionRequest::class)->disableOriginalConstructor()->getMock();
        $mockActionRequest->expects($this->atLeastOnce())->method('getHttpRequest')->will($this->returnValue($httpRequest));
        $this->token->updateCredentials($mockActionRequest);
        $this->assertEquals($expectedCredentials, $this->token->getCredentials());
        $this->assertSame(TokenInterface::AUTHENTICATION_NEEDED, $this->token->getAuthenticationStatus());
    }