Skip to content

Commit

Permalink
Minor optimizations.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Dec 6, 2010
1 parent d656bda commit 7c23d28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cake/libs/http_socket.php
Expand Up @@ -321,7 +321,7 @@ public function &request($request = array()) {
$response .= $data;
}

if ($connectionType == 'close') {
if ($connectionType === 'close') {
$this->disconnect();
}

Expand Down
7 changes: 3 additions & 4 deletions cake/tests/cases/libs/http_socket.test.php
Expand Up @@ -251,13 +251,12 @@ public function testConstruct() {
$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);

Expand Down

0 comments on commit 7c23d28

Please sign in to comment.