示例#1
0
 public function testWWWAuthenticateToStringReturnsHeaderFormattedString()
 {
     $this->markTestIncomplete('WWWAuthenticate needs to be completed');
     $wWWAuthenticateHeader = new WWWAuthenticate();
     // @todo set some values, then test output
     $this->assertEmpty('WWW-Authenticate: xxx', $wWWAuthenticateHeader->toString());
 }
 /**
  * According to RFC 2617 (http://www.ietf.org/rfc/rfc2617.txt), the 401 response message MUST
  * contain a WWW-Authenticate header
  *
  * {@inheritDoc}
  */
 public function prepareResponse(HttpResponse $response)
 {
     parent::prepareResponse($response);
     $headers = $response->getHeaders();
     $challenge = $this->getChallenge();
     $authenticateHeader = Header\WWWAuthenticate::fromString("WWW-Authenticate: {$challenge}");
     $headers->addHeader($authenticateHeader);
 }