You are here

public function ServerBagTest::testHttpDigestAuthWithPhpCgi in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Tests/ServerBagTest.php \Symfony\Component\HttpFoundation\Tests\ServerBagTest::testHttpDigestAuthWithPhpCgi()

File

vendor/symfony/http-foundation/Tests/ServerBagTest.php, line 102

Class

ServerBagTest
ServerBagTest.

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testHttpDigestAuthWithPhpCgi() {
  $digest = 'Digest username="foo", realm="acme", nonce="' . md5('secret') . '", uri="/protected, qop="auth"';
  $bag = new ServerBag(array(
    'HTTP_AUTHORIZATION' => $digest,
  ));
  $this
    ->assertEquals(array(
    'AUTHORIZATION' => $digest,
    'PHP_AUTH_DIGEST' => $digest,
  ), $bag
    ->getHeaders());
}