public function testFilterLocaleSwitchEvent()
 {
     $request = Request::create('/');
     $locale = 'de';
     $filter = new FilterLocaleSwitchEvent($request, $locale);
     $this->assertEquals('/', $filter->getRequest()->getPathInfo());
     $this->assertEquals('de', $filter->getLocale());
 }
 /**
  * Processes the locale updates. Adds listener for the cookie and updates the session.
  *
  * @param FilterLocaleSwitchEvent $event
  */
 public function onLocaleChange(FilterLocaleSwitchEvent $event)
 {
     $this->locale = $event->getLocale();
     $this->updateCookie($event->getRequest(), $this->localeCookie->setCookieOnChange());
     $this->updateSession();
 }