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

Commit

Permalink
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Client/Adapter/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ public function setOptions($options = array())
$this->setCurlOption(CURLOPT_PROXYPORT, $v);
break;
default:
if (is_array($v) && isset($this->config[$option]) && is_array($this->config[$option])) {
$v = ArrayUtils::merge($this->config[$option], $v);
}
$this->config[$option] = $v;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Headers.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function has($name)
}

/**
* Advance the pointer for this object as an interator
* Advance the pointer for this object as an iterator
*
* @return void
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Response/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Stream extends Response
protected $contentLength = null;

/**
* The portion of the body that has alredy been streamed
* The portion of the body that has already been streamed
*
* @var int
*/
Expand Down
24 changes: 24 additions & 0 deletions test/Client/CurlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,30 @@ public function testSetCurlOptions()
);
}

/**
* @group 4213
*/
public function testSetOptionsMergesCurlOptions()
{
$adapter = new Adapter\Curl();

$adapter->setOptions(array(
'curloptions' => array(
'foo' => 'bar',
),
));
$adapter->setOptions(array(
'curloptions' => array(
'bar' => 'baz',
),
));

$this->assertEquals(
array('curloptions' => array('foo' => 'bar', 'bar' => 'baz')),
$this->readAttribute($adapter, 'config')
);
}

public function testWorkWithProxyConfiguration()
{
$adapter = new Adapter\Curl();
Expand Down

0 comments on commit 6b14b45

Please sign in to comment.