Exemple #1
0
 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']);
 }
Exemple #2
0
 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)));
 }