public function testUnserializingInvalidStringRaisesException() { $value = 'a:foobar'; $this->setExpectedException('Zend\\Serializer\\Exception\\RuntimeException'); $this->adapter->unserialize($value); }
/** * Restore prev game session * * @return boolean TRUE if prev session exist and nto finished */ protected function restore() { if ($this->getStorage()->state !== self::STATE_CONTINUES) { return false; } $serializer = new PhpSerialize(); $this->player = $serializer->unserialize($this->getStorage()->player); $this->dealer = $serializer->unserialize($this->getStorage()->dealer); $this->game = new Model\GameSession(array($this->dealer, $this->player)); $this->game->setDeck($this->getStorage()->deck); return true; }