summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlain Tiemblo <alain.tiemblo@blablacar.com>2016-10-11 08:22:27 +0200
committerAlain Tiemblo <alain.tiemblo@blablacar.com>2016-10-11 08:22:27 +0200
commit151b07c418952a64c9f58c47ba14a25e1f3d2060 (patch)
treed1191f94d1acf4165738c1f6d8c9a663f9bbe831 /test
parent9ea03457478549eacd191d6476ae78a6b868af57 (diff)
downloadphp-http-client-151b07c418952a64c9f58c47ba14a25e1f3d2060.zip
php-http-client-151b07c418952a64c9f58c47ba14a25e1f3d2060.tar.gz
php-http-client-151b07c418952a64c9f58c47ba14a25e1f3d2060.tar.bz2
Added curlOptions property to customize curl instance
Diffstat (limited to 'test')
-rw-r--r--test/unit/ClientTest.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/unit/ClientTest.php b/test/unit/ClientTest.php
index 98218ac..762d56f 100644
--- a/test/unit/ClientTest.php
+++ b/test/unit/ClientTest.php
@@ -20,7 +20,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
'Content-Type: application/json',
'Authorization: Bearer SG.XXXX'
];
- $this->client = new MockClient($this->host, $this->headers, '/v3', null);
+ $this->client = new MockClient($this->host, $this->headers, '/v3', null, null);
}
public function testConstructor()
@@ -29,6 +29,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
$this->assertAttributeEquals($this->headers, 'headers', $this->client);
$this->assertAttributeEquals('/v3', 'version', $this->client);
$this->assertAttributeEquals([], 'path', $this->client);
+ $this->assertAttributeEquals([], 'curlOptions', $this->client);
$this->assertAttributeEquals(['delete', 'get', 'patch', 'post', 'put'], 'methods', $this->client);
}
@@ -96,4 +97,13 @@ class ClientTest extends \PHPUnit_Framework_TestCase
$client = new Client('https://localhost:4010', null, null, null);
$this->assertSame([], $client->getPath());
}
+
+ public function testGetCurlOptions()
+ {
+ $client = new Client('https://localhost:4010', null, null, null, [CURLOPT_PROXY => '127.0.0.1:8080']);
+ $this->assertSame([CURLOPT_PROXY => '127.0.0.1:8080'], $client->getCurlOptions());
+
+ $client = new Client('https://localhost:4010', null, null, null, null);
+ $this->assertSame([], $client->getCurlOptions());
+ }
} \ No newline at end of file