From 7c23d289e0945f0af53ef2e219ca5c4aa95c6aea Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Mon, 6 Dec 2010 12:03:22 -0200 Subject: [PATCH] Minor optimizations. --- cake/libs/http_socket.php | 2 +- cake/tests/cases/libs/http_socket.test.php | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index 84742fddd..545762b75 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -321,7 +321,7 @@ class HttpSocket extends CakeSocket { $response .= $data; } - if ($connectionType == 'close') { + if ($connectionType === 'close') { $this->disconnect(); } diff --git a/cake/tests/cases/libs/http_socket.test.php b/cake/tests/cases/libs/http_socket.test.php index 156dc9816..a7410231f 100644 --- a/cake/tests/cases/libs/http_socket.test.php +++ b/cake/tests/cases/libs/http_socket.test.php @@ -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);