Esempio n. 1
0
 public function testConstruction()
 {
     $result = 1;
     $code = 0;
     $message = 'System error';
     $data = [];
     $error = new Error($code, $message, $data);
     $id = 2;
     $response = new Response($result, $error, $id);
     $this->assertSame($result, $response->getResult());
     $this->assertSame($error, $response->getError());
     $this->assertSame($code, $response->getErrorCode());
     $this->assertSame($message, $response->getErrorMessage());
     $this->assertSame($data, $response->getErrorData());
     $this->assertSame($id, $response->getId());
 }
Esempio n. 2
0
 /**
  * @param Response $response
  */
 private function addResponse(Response $response)
 {
     $id = $response->getId();
     if (isset($this->keys[$id])) {
         $this->responses[$this->keys[$id]] = $response;
     }
 }