Skip to content

Commit 909de00

Browse files
Merge pull request #16 from Taluu/curl-options-build
Pass the curlOptions to the client in buildClient
2 parents 3c4c35e + 60ffeb0 commit 909de00

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private function buildClient($name = null)
105105
if (isset($name)) {
106106
$this->path[] = $name;
107107
}
108-
$client = new Client($this->host, $this->headers, $this->version, $this->path);
108+
$client = new Client($this->host, $this->headers, $this->version, $this->path, $this->curlOptions);
109109
$this->path = [];
110110
return $client;
111111
}

test/unit/ClientTest.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ public function testConstructor()
3535

3636
public function test_()
3737
{
38-
$client = $this->client->_('test');
38+
$client = new MockClient($this->host, $this->headers, '/v3', null, ['foo' => 'bar']);
39+
$client = $client->_('test');
40+
3941
$this->assertAttributeEquals(['test'], 'path', $client);
42+
$this->assertAttributeEquals(['foo' => 'bar'], 'curlOptions', $client);
4043
}
4144

4245
public function test__call()
@@ -106,4 +109,4 @@ public function testGetCurlOptions()
106109
$client = new Client('https://localhost:4010', null, null, null, null);
107110
$this->assertSame([], $client->getCurlOptions());
108111
}
109-
}
112+
}

0 commit comments

Comments
 (0)