public function testAddingAdapter() { $adapterMock = $this->getMock('\\Kokoroe\\Http\\Client\\Adapter\\AdapterInterface'); $client = new Client(); $client->setAdapter($adapterMock); $this->assertInstanceOf('\\Kokoroe\\Http\\Client\\Adapter\\AdapterInterface', $client->getAdapter()); $this->assertEquals($adapterMock, $client->getAdapter()); }
/** * 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; }