You are here

public function ResponseHeaderBagTest::testToStringIncludesCookieHeaders in Zircon Profile 8

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

File

vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php, line 124

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; path=/; httponly', explode("\r\n", $bag
    ->__toString()));
  $bag
    ->clearCookie('foo');
  $this
    ->assertRegExp('#^Set-Cookie: foo=deleted; expires=' . gmdate('D, d-M-Y H:i:s T', time() - 31536001) . '; path=/; httponly#m', $bag
    ->__toString());
}