public function getData($key) { if ($this->started !== true) { throw new Exception\SessionNotStartedException('The session has not been started yet.', 1218034660); } return array_key_exists($key, $this->data) ? $this->data[$key] : null; }
/** * @test */ public function allSessionDataCanBeFlushedByCallingDestroy() { $session = new Session\TransientSession(); $session->start(); $session->putData('theKey', 'some data'); $session->destroy(); $session->start(); $this->assertNull($session->getData('theKey')); }