Пример #1
0
 protected function unserializeResult($resultJson)
 {
     if ($resultJson instanceof PromiseInterface) {
         return $resultJson;
     }
     if ($this->isId($resultJson)) {
         return $resultJson;
     }
     try {
         return JsonCoder::jsonUnserialize($resultJson);
     } catch (PromiseException $ex) {
         throw new PromiseException("Cannot unserialize string: " . $resultJson, 0, $ex);
     }
 }
Пример #2
0
 public function testJsonCoder_ExceptionJsonSerialize()
 {
     $e1 = new PromiseException('Exception1', 1);
     $e11 = new PromiseException('Exception11', 11, $e1);
     $this->assertEquals($e11, JsonCoder::jsonUnserialize(JsonCoder::jsonSerialize($e11)));
 }