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:
the_undefined 2008-01-22 23:17:55 +00:00
parent 59cf6c8fc0
commit 38c705a06b
2 changed files with 8 additions and 0 deletions

View file

@ -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);

View file

@ -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);
}
/**