Пример #1
0
 public function testUnserializingInvalidStringRaisesException()
 {
     $value = 'a:foobar';
     $this->setExpectedException('Zend\\Serializer\\Exception\\RuntimeException');
     $this->adapter->unserialize($value);
 }
Пример #2
0
 /**
  * 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;
 }