Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

src/Client/Adapter/Curl.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ public function setOptions($options = array())
134134
$this->setCurlOption(CURLOPT_PROXYPORT, $v);
135135
break;
136136
default:
137+
if (is_array($v) && isset($this->config[$option]) && is_array($this->config[$option])) {
138+
$v = ArrayUtils::merge($this->config[$option], $v);
139+
}
137140
$this->config[$option] = $v;
138141
break;
139142
}

src/Headers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public function has($name)
286286
}
287287

288288
/**
289-
* Advance the pointer for this object as an interator
289+
* Advance the pointer for this object as an iterator
290290
*
291291
* @return void
292292
*/

src/Response/Stream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Stream extends Response
2626
protected $contentLength = null;
2727

2828
/**
29-
* The portion of the body that has alredy been streamed
29+
* The portion of the body that has already been streamed
3030
*
3131
* @var int
3232
*/

test/Client/CurlTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,30 @@ public function testSetCurlOptions()
254254
);
255255
}
256256

257+
/**
258+
* @group 4213
259+
*/
260+
public function testSetOptionsMergesCurlOptions()
261+
{
262+
$adapter = new Adapter\Curl();
263+
264+
$adapter->setOptions(array(
265+
'curloptions' => array(
266+
'foo' => 'bar',
267+
),
268+
));
269+
$adapter->setOptions(array(
270+
'curloptions' => array(
271+
'bar' => 'baz',
272+
),
273+
));
274+
275+
$this->assertEquals(
276+
array('curloptions' => array('foo' => 'bar', 'bar' => 'baz')),
277+
$this->readAttribute($adapter, 'config')
278+
);
279+
}
280+
257281
public function testWorkWithProxyConfiguration()
258282
{
259283
$adapter = new Adapter\Curl();

0 commit comments

Comments
 (0)