From 60ffeb08f27c1c87345a713c482eca8edc1a47bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Clavi=C3=A9?= Date: Fri, 13 Jan 2017 13:40:40 +0100 Subject: [PATCH] Pass the curlOptions to the client in buildClient --- lib/Client.php | 2 +- test/unit/ClientTest.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Client.php b/lib/Client.php index a383cc0..cb9b24f 100644 --- a/lib/Client.php +++ b/lib/Client.php @@ -105,7 +105,7 @@ private function buildClient($name = null) if (isset($name)) { $this->path[] = $name; } - $client = new Client($this->host, $this->headers, $this->version, $this->path); + $client = new Client($this->host, $this->headers, $this->version, $this->path, $this->curlOptions); $this->path = []; return $client; } diff --git a/test/unit/ClientTest.php b/test/unit/ClientTest.php index 762d56f..676f600 100644 --- a/test/unit/ClientTest.php +++ b/test/unit/ClientTest.php @@ -35,8 +35,11 @@ public function testConstructor() public function test_() { - $client = $this->client->_('test'); + $client = new MockClient($this->host, $this->headers, '/v3', null, ['foo' => 'bar']); + $client = $client->_('test'); + $this->assertAttributeEquals(['test'], 'path', $client); + $this->assertAttributeEquals(['foo' => 'bar'], 'curlOptions', $client); } public function test__call() @@ -106,4 +109,4 @@ public function testGetCurlOptions() $client = new Client('https://localhost:4010', null, null, null, null); $this->assertSame([], $client->getCurlOptions()); } -} \ No newline at end of file +}