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 +}