public function testRestArray()
 {
     $clients = Client::Rest(static::$credentials[0], static::$credentials[1], static::$services);
     foreach ($clients as $key => $client) {
         $matchingServiceName = static::$services[$key];
         $this->assertInstanceOf(RestClient::ns() . "\\{$matchingServiceName}", $client);
     }
 }
 /**
  * Test query map
  *
  * @dataProvider provideResourceReferenceFixtures
  * 
  * @param string $fixture
  */
 public function testQueryMap($fixture)
 {
     $reference = AbstractClient::response($fixture);
     $map = array('a' => 'a', 'b' => 'b', 'c' => 'c');
     $reference->setQueryMap($map);
     $idempotentMap = $reference->getQueryMap();
     $this->assertEquals($map, $idempotentMap);
 }
Example #3
0
 /**
  * Instantiate a REST service client
  *
  * @static
  * @param  string                   $username API Login
  * @param  string                   $password API Password
  * @param  string                   $service  Service name
  * @return CallFire\Api\Rest\Client REST API client
  */
 protected static function createRestClient($username, $password, $service)
 {
     $serviceClass = RestClient::ns() . "\\{$service}";
     $client = new $serviceClass();
     $client->setUsername($username);
     $client->setPassword($password);
     return $client;
 }