public function ResponseHeaderBagTest::testToStringIncludesCookieHeaders

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php, line 67

Class

ResponseHeaderBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testToStringIncludesCookieHeaders() {
  $bag = new ResponseHeaderBag(array());
  $bag
    ->setCookie(new Cookie('foo', 'bar'));
  $this
    ->assertContains("Set-Cookie: foo=bar; httponly", explode("\r\n", $bag
    ->__toString()));
  $bag
    ->clearCookie('foo');
  $this
    ->assertContains("Set-Cookie: foo=deleted; expires=" . gmdate("D, d-M-Y H:i:s T", time() - 31536001) . "; httponly", explode("\r\n", $bag
    ->__toString()));
}