mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 00:48:25 +00:00
Fixed some issue with initializing the HttpSocket in a certain way
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6403 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
59cf6c8fc0
commit
38c705a06b
2 changed files with 8 additions and 0 deletions
|
@ -152,6 +152,10 @@ class HttpSocket extends CakeSocket {
|
|||
if (is_string($config)) {
|
||||
$this->configUri($config);
|
||||
} elseif (is_array($config)) {
|
||||
if (isset($config['request']['uri']) && is_string($config['request']['uri'])) {
|
||||
$this->configUri($config['request']['uri']);
|
||||
unset($config['request']['uri']);
|
||||
}
|
||||
$this->config = Set::merge($this->config, $config);
|
||||
}
|
||||
parent::__construct($this->config);
|
||||
|
|
|
@ -79,6 +79,10 @@ class HttpSocketTest extends UnitTestCase {
|
|||
$baseConfig['request']['uri']['port'] = 23;
|
||||
$baseConfig['protocol'] = getprotobyname($baseConfig['protocol']);
|
||||
$this->assertIdentical($this->Socket->config, $baseConfig);
|
||||
|
||||
$this->Socket->reset();
|
||||
$this->Socket->__construct(array('request' => array('uri' => 'http://www.cakephp.org:23/')));
|
||||
$this->assertIdentical($this->Socket->config, $baseConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue