Пример #1
0
 /**
  * @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());
 }
Пример #2
0
 /**
  * @param $data
  * @return Response
  */
 protected function getResponse($data)
 {
     return Response::fromArray((array) $data);
 }