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

destroyRemovesAllSessionDataFromTheCurrentSessionButNotFromOtherSessions() public method

    public function destroyRemovesAllSessionDataFromTheCurrentSessionButNotFromOtherSessions()
    {
        $session1 = new Session();
        $session2 = new Session();
        $this->inject($session1, 'bootstrap', $this->mockBootstrap);
        $this->inject($session2, 'bootstrap', $this->mockBootstrap);
        $this->inject($session1, 'settings', $this->settings);
        $this->inject($session2, 'settings', $this->settings);
        $metaDataCache = $this->createCache('Meta');
        $storageCache = $this->createCache('Storage');
        $this->inject($session1, 'metaDataCache', $metaDataCache);
        $this->inject($session1, 'storageCache', $storageCache);
        $this->inject($session2, 'metaDataCache', $metaDataCache);
        $this->inject($session2, 'storageCache', $storageCache);
        $session1->initializeObject();
        $session2->initializeObject();
        $session1->start();
        $session2->start();
        $session1->putData('session 1 key 1', 'some value');
        $session1->putData('session 1 key 2', 'some other value');
        $session2->putData('session 2 key', 'some value');
        $session1->destroy(__METHOD__);
        $this->inject($session1, 'started', true);
        $this->inject($session2, 'started', true);
        $this->assertFalse($session1->hasKey('session 1 key 1'));
        $this->assertFalse($session1->hasKey('session 1 key 2'));
        $this->assertTrue($session2->hasKey('session 2 key'), 'Entry in session was also removed.');
    }
SessionTest