You are here

public function ResponseTest::testMagicToStringWithMultipleSetCookieHeader in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/browser-kit/Tests/ResponseTest.php \Symfony\Component\BrowserKit\Tests\ResponseTest::testMagicToStringWithMultipleSetCookieHeader()

File

vendor/symfony/browser-kit/Tests/ResponseTest.php, line 60

Class

ResponseTest

Namespace

Symfony\Component\BrowserKit\Tests

Code

public function testMagicToStringWithMultipleSetCookieHeader() {
  $headers = array(
    'content-type' => 'text/html; charset=utf-8',
    'set-cookie' => array(
      'foo=bar',
      'bar=foo',
    ),
  );
  $expected = 'content-type: text/html; charset=utf-8' . "\n";
  $expected .= 'set-cookie: foo=bar' . "\n";
  $expected .= 'set-cookie: bar=foo' . "\n\n";
  $expected .= 'foo';
  $response = new Response('foo', 304, $headers);
  $this
    ->assertEquals($expected, $response
    ->__toString(), '->__toString() returns the headers and the content as a string');
}