Minor optimizations.

This commit is contained in:
Juan Basso 2010-12-06 12:03:22 -02:00
parent d656bdae3b
commit 7c23d289e0
2 changed files with 4 additions and 5 deletions

View file

@ -321,7 +321,7 @@ class HttpSocket extends CakeSocket {
$response .= $data;
}
if ($connectionType == 'close') {
if ($connectionType === 'close') {
$this->disconnect();
}

View file

@ -251,13 +251,12 @@ class HttpSocketTest extends CakeTestCase {
$baseConfig['host'] = 'foo-bar';
$baseConfig['protocol'] = getprotobyname($baseConfig['protocol']);
$this->assertEquals($this->Socket->config, $baseConfig);
$this->Socket->reset();
$baseConfig = $this->Socket->config;
$this->Socket->__construct('http://www.cakephp.org:23/');
$baseConfig['host'] = 'www.cakephp.org';
$baseConfig['request']['uri']['host'] = 'www.cakephp.org';
$baseConfig['port'] = 23;
$baseConfig['request']['uri']['port'] = 23;
$baseConfig['host'] = $baseConfig['request']['uri']['host'] = 'www.cakephp.org';
$baseConfig['port'] = $baseConfig['request']['uri']['port'] = 23;
$baseConfig['protocol'] = getprotobyname($baseConfig['protocol']);
$this->assertEquals($this->Socket->config, $baseConfig);