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()); }
/** * @param Response $response */ private function addResponse(Response $response) { $id = $response->getId(); if (isset($this->keys[$id])) { $this->responses[$this->keys[$id]] = $response; } }