public function testRegenerateId() { $session = new CM_Session(); $session->set('foo', 'bar'); $sessionId = $session->getId(); unset($session); $session = new CM_Session($sessionId); $oldSessionId = $session->getId(); $session->regenerateId(); $newSessionId = $session->getId(); unset($session); try { new CM_Session($oldSessionId); $this->fail('Db entry not updated.'); } catch (CM_Exception_Nonexistent $ex) { $this->assertTrue(true); } try { $session = new CM_Session($newSessionId); $this->assertTrue(true); } catch (CM_Exception_Nonexistent $ex) { $this->fail('Db entry not updated.'); } $this->assertEquals('bar', $session->get('foo')); }