Example #1
0
 public function testGettingAllMethodSignaturesDefaultsToMulticall()
 {
     // system.listMethods() will return ['foo', 'bar']
     $whatListMethodsReturns = array('foo', 'bar');
     $response = $this->getServerResponseFor($whatListMethodsReturns);
     $this->httpAdapter->setResponse($response);
     // system.multicall() will then return [fooSignatures, barSignatures]
     $fooSignatures = array(array('int'), array('int', 'string'));
     $barSignatures = array(array('boolean'));
     $whatMulticallReturns = array($fooSignatures, $barSignatures);
     $response = $this->getServerResponseFor($whatMulticallReturns);
     $this->httpAdapter->addResponse($response);
     $i = $this->xmlrpcClient->getIntrospector();
     $expected = array('foo' => $fooSignatures, 'bar' => $barSignatures);
     $this->assertEquals($expected, $i->getSignatureForEachMethod());
     $request = $this->xmlrpcClient->getLastRequest();
     $this->assertEquals('system.multicall', $request->getMethod());
 }
Example #2
0
 public function testSettingAndGettingIntrospector()
 {
     $xmlrpcClient = new Client('http://foo');
     $introspector = new Client\ServerIntrospection($xmlrpcClient);
     $this->assertNotSame($introspector, $xmlrpcClient->getIntrospector());
     $xmlrpcClient->setIntrospector($introspector);
     $this->assertSame($introspector, $xmlrpcClient->getIntrospector());
 }