HttpSocket::_configUri() always change config attribute and it is public. This function dont need return it.

This commit is contained in:
Juan Basso 2010-12-06 04:02:23 -02:00
parent 33bb253dfa
commit 30a70b700b
2 changed files with 7 additions and 7 deletions

View file

@ -674,7 +674,7 @@ class HttpSocket extends CakeSocket {
* 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)) {
@ -697,7 +697,7 @@ class HttpSocket extends CakeSocket {
);
$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;
}
/**

View file

@ -290,12 +290,12 @@ class HttpSocketTest extends CakeTestCase {
)
);
$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(
@ -314,13 +314,13 @@ class HttpSocketTest extends CakeTestCase {
)
);
$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);
}
/**