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

getTagsOnAResumedSessionReturnsTheTagsSetWithAddTag() public method

    public function getTagsOnAResumedSessionReturnsTheTagsSetWithAddTag()
    {
        $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->addTag('SampleTag');
        $session->addTag('AnotherTag');
        $session->close();
        // Create a new, clean session object to make sure that the tags were really
        // loaded from the cache:
        $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(['SampleTag', 'AnotherTag'], $session->getTags());
    }
SessionTest