public function testClientCallReturnResultBatch() { $trp = new MockTransport(array('subtract' => function ($a, $b) { return $a - $b; })); $client = new Callchedan\Client($trp); $id = $client->addCall('subtract', array(42, 23)); $result = $client->batchRequest(); $this->assertEquals($id, $result[0]['id']); $this->assertEquals(19, $result[0]['result']); }
public function testNamedShouldReturnResult() { $client = new Callchedan\Client('http://php.loc/callchedan/tests/server/server.php'); $this->assertEquals(19, $client->call('subtractNamed', array('minuend' => 42, 'subtrahend' => 23))); }