Neos\Flow\Tests\Unit\Session\SessionTest::sessionDataCanBeRetrievedEvenAfterSessionIdHasBeenRenewed PHP Method

sessionDataCanBeRetrievedEvenAfterSessionIdHasBeenRenewed() public method

    public function sessionDataCanBeRetrievedEvenAfterSessionIdHasBeenRenewed()
    {
        $metaDataCache = $this->createCache('Meta');
        $storageCache = $this->createCache('Storage');
        $session = new Session();
        $this->inject($session, 'bootstrap', $this->mockBootstrap);
        $this->inject($session, 'objectManager', $this->mockObjectManager);
        $this->inject($session, 'settings', $this->settings);
        $this->inject($session, 'metaDataCache', $metaDataCache);
        $this->inject($session, 'storageCache', $storageCache);
        $session->initializeObject();
        $session->start();
        $session->putData('foo', 'bar');
        $session->renewId();
        $session->close();
        $sessionCookie = $this->httpResponse->getCookie($this->settings['session']['name']);
        $this->httpRequest->setCookie($sessionCookie);
        $session = new Session();
        $this->inject($session, 'bootstrap', $this->mockBootstrap);
        $this->inject($session, 'objectManager', $this->mockObjectManager);
        $this->inject($session, 'settings', $this->settings);
        $this->inject($session, 'metaDataCache', $metaDataCache);
        $this->inject($session, 'storageCache', $storageCache);
        $session->initializeObject();
        $session->resume();
        $this->assertEquals('bar', $session->getData('foo'));
    }
SessionTest