/** * @covers \Moaction\Jsonrpc\Common\Response::fromArray */ public function testResult() { $data = array('jsonrpc' => Request::VERSION, 'id' => 5, 'result' => array('Hello world')); $response = Response::fromArray($data); $this->assertEquals(5, $response->getId()); $this->assertEquals(array('Hello world'), $response->getResult()); }
/** * @param $data * @return Response */ protected function getResponse($data) { return Response::fromArray((array) $data); }