$this->
assertEquals('Request: /',
$client->
getResponse()->
getContent(), '->getScript() returns a script that uses the request handler to make the request'
);
} public function testFilterResponseConvertsCookies() { $client =
new HttpKernelBrowser(new TestHttpKernel());
$r =
new \
ReflectionObject($client);
$m =
$r->
getMethod('filterResponse'
);
$response =
new Response();
$response->headers->
setCookie($cookie1 =
new Cookie('foo', 'bar', \DateTimeImmutable::
createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT'
)->
format('U'
), '/foo', 'http://example.com', true, true, false, null
));
$domResponse =
$m->
invoke($client,
$response);
$this->
assertSame((string) $cookie1,
$domResponse->
getHeader('Set-Cookie'
));
$response =
new Response();
$response->headers->
setCookie($cookie1 =
new Cookie('foo', 'bar', \DateTimeImmutable::
createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT'
)->
format('U'
), '/foo', 'http://example.com', true, true, false, null
));
$response->headers->
setCookie($cookie2 =
new Cookie('foo1', 'bar1', \DateTimeImmutable::
createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT'
)->
format('U'
), '/foo', 'http://example.com', true, true, false, null
));
$domResponse =
$m->
invoke($client,
$response);
$this->
assertSame((string) $cookie1,
$domResponse->
getHeader('Set-Cookie'
));
$this->
assertSame([(string) $cookie1,
(string) $cookie2],
$domResponse->
getHeader('Set-Cookie', false
));
}