public function putData($key, $data) { if ($this->started !== true) { throw new Exception\SessionNotStartedException('The session has not been started yet.', 1218034661); } $this->data[$key] = $data; }
/** * @test */ public function hasKeyReturnsTrueOrFalseAccordingToAvailableKeys() { $session = new Session\TransientSession(); $session->start(); $session->putData('theKey', 'some data'); $this->assertTrue($session->hasKey('theKey')); $this->assertFalse($session->hasKey('noKey')); }