mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
HttpSocket::_configUri() always change config attribute and it is public. This function dont need return it.
This commit is contained in:
parent
33bb253dfa
commit
30a70b700b
2 changed files with 7 additions and 7 deletions
|
@ -674,7 +674,7 @@ class HttpSocket extends CakeSocket {
|
||||||
* Parses and sets the specified URI into current request configuration.
|
* Parses and sets the specified URI into current request configuration.
|
||||||
*
|
*
|
||||||
* @param mixed $uri URI, See HttpSocket::_parseUri()
|
* @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) {
|
protected function _configUri($uri = null) {
|
||||||
if (empty($uri)) {
|
if (empty($uri)) {
|
||||||
|
@ -697,7 +697,7 @@ class HttpSocket extends CakeSocket {
|
||||||
);
|
);
|
||||||
$this->config = Set::merge($this->config, $config);
|
$this->config = Set::merge($this->config, $config);
|
||||||
$this->config = Set::merge($this->config, array_intersect_key($this->config['request']['uri'], $this->config));
|
$this->config = Set::merge($this->config, array_intersect_key($this->config['request']['uri'], $this->config));
|
||||||
return $this->config;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -290,12 +290,12 @@ class HttpSocketTest extends CakeTestCase {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->assertEquals($this->Socket->config, $expected);
|
$this->assertEquals($this->Socket->config, $expected);
|
||||||
$this->assertEquals($r, $expected);
|
$this->assertTrue($r);
|
||||||
$r = $this->Socket->configUri(array('host' => 'www.foo-bar.org'));
|
$r = $this->Socket->configUri(array('host' => 'www.foo-bar.org'));
|
||||||
$expected['host'] = 'www.foo-bar.org';
|
$expected['host'] = 'www.foo-bar.org';
|
||||||
$expected['request']['uri']['host'] = 'www.foo-bar.org';
|
$expected['request']['uri']['host'] = 'www.foo-bar.org';
|
||||||
$this->assertEquals($this->Socket->config, $expected);
|
$this->assertEquals($this->Socket->config, $expected);
|
||||||
$this->assertEquals($r, $expected);
|
$this->assertTrue($r);
|
||||||
|
|
||||||
$r = $this->Socket->configUri('http://www.foo.com');
|
$r = $this->Socket->configUri('http://www.foo.com');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
@ -314,13 +314,13 @@ class HttpSocketTest extends CakeTestCase {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->assertEquals($this->Socket->config, $expected);
|
$this->assertEquals($this->Socket->config, $expected);
|
||||||
$this->assertEquals($r, $expected);
|
$this->assertTrue($r);
|
||||||
$r = $this->Socket->configUri('/this-is-broken');
|
$r = $this->Socket->configUri('/this-is-broken');
|
||||||
$this->assertEquals($this->Socket->config, $expected);
|
$this->assertEquals($this->Socket->config, $expected);
|
||||||
$this->assertEquals($r, false);
|
$this->assertFalse($r);
|
||||||
$r = $this->Socket->configUri(false);
|
$r = $this->Socket->configUri(false);
|
||||||
$this->assertEquals($this->Socket->config, $expected);
|
$this->assertEquals($this->Socket->config, $expected);
|
||||||
$this->assertEquals($r, false);
|
$this->assertFalse($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue