コード例 #1
0
 /**
  * @test
  */
 public function shouldAddLoggingPluginWhenEnabled()
 {
     $token = new ApiToken(self::API_TOKEN);
     $client = new Client($token, ['log' => ['enabled' => true]]);
     $listeners = $client->getHttpClient()->getAdapter()->getClient()->getEmitter()->listeners();
     $this->assertEquals(true, $this->isListenerRegistered($listeners, 'GuzzleHttp\\Subscriber\\Log\\LogSubscriber'));
 }
コード例 #2
0
ファイル: AbstractApi.php プロジェクト: n10ty/api
 /**
  * Send a PATCH request
  *
  * @param $path
  * @param  null  $body
  * @param  array $parameters
  * @param  array $headers
  * @return mixed
  */
 public function patch($path, $body = null, array $parameters = array(), $headers = array())
 {
     /**
      * @var Response $response
      */
     $response = $this->client->getHttpClient()->patch($path, $body, $parameters, $headers);
     return $response->json();
 }
コード例 #3
0
 public function setUp()
 {
     $client = new Client(new ApiToken('abcdef'));
     $factory = new \Tmdb\Factory\ConfigurationFactory($client->getHttpClient());
     $data = $this->loadByFile('configuration/get.json');
     $configuration = $factory->create($data);
     $this->helper = new \Tmdb\Helper\ImageHelper($configuration);
 }
コード例 #4
0
 public function setUp()
 {
     $client = new Client(new ApiToken('abcdef'));
     $this->collection = new Images();
     foreach ($this->images as $image) {
         $factory = new ImageFactory($client->getHttpClient());
         $object = $factory->create($image);
         $this->collection->addImage($object);
     }
 }
コード例 #5
0
 /**
  * Shortcut to obtain the http client adapter
  *
  * @return \Tmdb\HttpClient\Adapter\AdapterInterface
  */
 protected function getAdapter()
 {
     return $this->_client->getHttpClient()->getAdapter();
 }
コード例 #6
0
 protected function getHttpClient()
 {
     return $this->client->getHttpClient();
 }