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;
} } throw new \
InvalidArgumentException(sprintf('Cookie named "%s" is not in response',
$name));
}