/** * @dataProvider buildKernelProvider */ public function testOnBuildKernelHandler($sessionName, $isStarted, $storageKey, $hasPreviousSession) { $this->session->expects($this->once())->method('getName')->will($this->returnValue($sessionName)); $this->session->expects($this->once())->method('isStarted')->will($this->returnValue($isStarted)); $this->request->expects($this->once())->method('hasPreviousSession')->will($this->returnValue($hasPreviousSession)); $sessionMapper = new SessionMapper($this->sessionStorage, $storageKey, $this->session); $sessionMapper->setRequestStack($this->requestStack); $event = new PreBuildKernelEvent(new ParameterBag(), $this->request); $sessionMapper->onBuildKernelHandler($event); $this->assertSame(array('session' => array('configured' => true, 'started' => $isStarted, 'name' => $sessionName, 'namespace' => $storageKey, 'has_previous' => $hasPreviousSession, 'storage' => $this->sessionStorage), 'injected-settings' => array('site.ini/Session/CookieTimeout' => false, 'site.ini/Session/CookiePath' => false, 'site.ini/Session/CookieDomain' => false, 'site.ini/Session/CookieSecure' => false, 'site.ini/Session/CookieHttponly' => false)), $event->getParameters()->all()); }