Ejemplo n.º 1
0
 public function testSendDeleteRequest()
 {
     $adapterMock = $this->getMock('\\Kokoroe\\Http\\Client\\Adapter\\AdapterInterface');
     $adapterMock->method('send')->with($this->equalTo('DELETE'), $this->equalTo('https://api.kokoroe.co/v1.0/me?access_token=foo'), $this->equalTo(null), ['Accept-Language' => 'fr-FR']);
     $client = new Client();
     $client->setAdapter($adapterMock);
     $client->delete('https://api.kokoroe.co/v1.0/me', ['access_token' => 'foo'], ['Accept-Language' => 'fr-FR']);
 }
Ejemplo n.º 2
0
 /**
  * Set http client
  *
  * @param Http\Client $client
  * @return Kokoroe
  */
 public function setHttpClient(Http\Client $client)
 {
     $this->http = $client;
     $this->http->setLogger($this->logger);
     $this->http->getAdapter()->setSslVerify($this->sslVerify);
     if ($this->hasSignature()) {
         $this->getSignature()->setKey($this->clientSecret);
         $this->http->setSignature($this->getSignature());
     }
     return $this;
 }