/**
  * @test
  */
 public function credentialsAreSetCorrectlyForCGI()
 {
     $expectedCredentials = array('username' => 'robert', 'password' => 'mysecretpassword, containing a : colon ;-)');
     $serverEnvironment = array('REDIRECT_REMOTE_AUTHORIZATION' => 'Basic ' . base64_encode($expectedCredentials['username'] . ':' . $expectedCredentials['password']));
     $httpRequest = Request::create(new Uri('http://foo.com'), 'GET', array(), array(), $serverEnvironment);
     $mockActionRequest = $this->getMockBuilder(\TYPO3\Flow\Mvc\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());
 }
 /**
  * @test
  */
 public function credentialsAreSetCorrectlyForCGI()
 {
     $expectedCredentials = array('username' => 'robert', 'password' => 'mysecretpassword, containing a : colon ;-)');
     $serverEnvironment = array('REDIRECT_REMOTE_AUTHORIZATION' => 'Basic ' . base64_encode($expectedCredentials['username'] . ':' . $expectedCredentials['password']));
     $request = Request::create(new Uri('http://foo.com'), 'GET', array(), array(), $serverEnvironment);
     $actionRequest = $request->createActionRequest();
     $token = new UsernamePasswordHttpBasic();
     $token->updateCredentials($actionRequest);
     $this->assertEquals($expectedCredentials, $token->getCredentials());
     $this->assertSame(TokenInterface::AUTHENTICATION_NEEDED, $token->getAuthenticationStatus());
 }