Skip to content

Commit

Permalink
HttpSocket::_configUri() always change config attribute and it is pub…
Browse files Browse the repository at this point in the history
…lic. This function dont need return it.
  • Loading branch information
jrbasso committed Dec 6, 2010
1 parent 33bb253 commit 30a70b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cake/libs/http_socket.php
Expand Up @@ -674,7 +674,7 @@ protected function _decodeChunkedBody($body) {
* Parses and sets the specified URI into current request configuration.
*
* @param mixed $uri URI, See HttpSocket::_parseUri()
* @return array Current configuration settings
* @return boolean If uri has merged in config
*/
protected function _configUri($uri = null) {
if (empty($uri)) {
Expand All @@ -697,7 +697,7 @@ protected function _configUri($uri = null) {
);
$this->config = Set::merge($this->config, $config);
$this->config = Set::merge($this->config, array_intersect_key($this->config['request']['uri'], $this->config));
return $this->config;
return true;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions cake/tests/cases/libs/http_socket.test.php
Expand Up @@ -290,12 +290,12 @@ public function testConfigUri() {
)
);
$this->assertEquals($this->Socket->config, $expected);
$this->assertEquals($r, $expected);
$this->assertTrue($r);
$r = $this->Socket->configUri(array('host' => 'www.foo-bar.org'));
$expected['host'] = 'www.foo-bar.org';
$expected['request']['uri']['host'] = 'www.foo-bar.org';
$this->assertEquals($this->Socket->config, $expected);
$this->assertEquals($r, $expected);
$this->assertTrue($r);

$r = $this->Socket->configUri('http://www.foo.com');
$expected = array(
Expand All @@ -314,13 +314,13 @@ public function testConfigUri() {
)
);
$this->assertEquals($this->Socket->config, $expected);
$this->assertEquals($r, $expected);
$this->assertTrue($r);
$r = $this->Socket->configUri('/this-is-broken');
$this->assertEquals($this->Socket->config, $expected);
$this->assertEquals($r, false);
$this->assertFalse($r);
$r = $this->Socket->configUri(false);
$this->assertEquals($this->Socket->config, $expected);
$this->assertEquals($r, false);
$this->assertFalse($r);
}

/**
Expand Down

0 comments on commit 30a70b7

Please sign in to comment.