$response->headers->
setCookie(new Cookie('bazz', 'foo', '2000-12-12', '/', null, false, true, false, null
));
return $response;
} /**
* Inject the given controller callable into the data collector.
*/
protected function injectController($collector,
$controller,
$request) { $resolver =
$this->
createMock(ControllerResolverInterface::
class);
$httpKernel =
new HttpKernel(new EventDispatcher(),
$resolver, null,
$this->
createMock(ArgumentResolverInterface::
class));
$event =
new ControllerEvent($httpKernel,
$controller,
$request, HttpKernelInterface::MAIN_REQUEST
);
$collector->
onKernelController($event);
} private function getCookieByName(Response
$response,
$name) { foreach ($response->headers->
getCookies() as $cookie) { if ($cookie->
getName() ==
$name) { return $cookie;
} }