示例#1
0
 /**
  * @covers \Moaction\Jsonrpc\Common\Request::setId
  * @covers \Moaction\Jsonrpc\Common\Request::setParams
  * @covers \Moaction\Jsonrpc\Common\Request::setMethod
  * @covers \Moaction\Jsonrpc\Common\Request::getId
  * @covers \Moaction\Jsonrpc\Common\Request::getParams
  * @covers \Moaction\Jsonrpc\Common\Request::getMethod
  */
 public function testGettersSetters()
 {
     $request = new Request();
     $request->setId(10);
     $request->setParams(array('params'));
     $request->setMethod('method');
     $this->assertEquals(10, $request->getId());
     $this->assertEquals(array('params'), $request->getParams());
     $this->assertEquals('method', $request->getMethod());
 }
 /**
  * @return array
  */
 public function providerTestCall()
 {
     $request1 = new Request();
     $request1->setMethod('method1');
     $request1->setParams(array('param1' => 'value1'));
     $request1->setId(2);
     $request2 = new Request();
     $request2->setMethod('method2');
     $request3 = new Request();
     return array('Empty request' => array($request3, false), 'Notification' => array($request2, '{"jsonrpc":"2.0","method":"method2"}'), 'Valid request' => array($request1, '{"jsonrpc":"2.0","method":"method1","params":{"param1":"value1"},"id":2}'));
 }