/** * Test CookieInjector:inject() method. */ public function testCookieInjection() { $cookieName = 'test'; $cookieValue = 'test_value'; $cookieInjector = new CookieInjector(); $request = $this->createRequestMock($cookieName, $cookieValue); $cookieModel = new GenericCookie($cookieName); $cookieInjector->addCookieModel($cookieModel); $cookieInjector->inject($request); $this->assertEquals($cookieValue, $cookieModel->getValue()); }
/** * OnKernelRequest. * * @param GetResponseEvent $event */ public function onKernelRequest(GetResponseEvent $event) { $this->cookieInjector->inject($event->getRequest()); }