You are here

public function ServerBagTest::testHttpDigestAuthWithPhpCgiBogus in Zircon Profile 8

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

File

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

Class

ServerBagTest
ServerBagTest.

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testHttpDigestAuthWithPhpCgiBogus() {
  $digest = 'Digest_username="foo", realm="acme", nonce="' . md5('secret') . '", uri="/protected, qop="auth"';
  $bag = new ServerBag(array(
    'HTTP_AUTHORIZATION' => $digest,
  ));

  // Username and passwords should not be set as the header is bogus
  $headers = $bag
    ->getHeaders();
  $this
    ->assertFalse(isset($headers['PHP_AUTH_USER']));
  $this
    ->assertFalse(isset($headers['PHP_AUTH_PW']));
}