Skip to content

Commit

Permalink
Removing dependancy on Object from CakeSocket. Making tests less depe…
Browse files Browse the repository at this point in the history
…ndant on having a network connection.
  • Loading branch information
markstory committed Apr 24, 2010
1 parent e8b6d45 commit 9ddbd6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions cake/libs/cake_socket.php
Expand Up @@ -27,7 +27,7 @@
* @package cake
* @subpackage cake.cake.libs
*/
class CakeSocket extends Object {
class CakeSocket {

/**
* Object description
Expand Down Expand Up @@ -90,8 +90,6 @@ class CakeSocket extends Object {
* @see CakeSocket::$_baseConfig
*/
function __construct($config = array()) {
parent::__construct();

$this->config = array_merge($this->_baseConfig, $config);
if (!is_numeric($this->config['protocol'])) {
$this->config['protocol'] = getprotobyname($this->config['protocol']);
Expand Down
4 changes: 2 additions & 2 deletions cake/tests/cases/libs/cake_socket.test.php
Expand Up @@ -145,13 +145,13 @@ function testSocketReading() {
$this->Socket->connect();
$this->assertEqual($this->Socket->read(26), null);

$config = array('host' => 'www.cakephp.org', 'timeout' => 1);
$config = array('host' => '127.0.0.1', 'timeout' => 1);
$this->Socket = new CakeSocket($config);
$this->assertTrue($this->Socket->connect());
$this->assertFalse($this->Socket->read(1024 * 1024));
$this->assertEqual($this->Socket->lastError(), '2: ' . __('Connection timed out'));

$config = array('host' => 'www.cakephp.org', 'timeout' => 30);
$config = array('host' => 'localhost', 'timeout' => 30);
$this->Socket = new CakeSocket($config);
$this->assertTrue($this->Socket->connect());
$this->assertEqual($this->Socket->read(26), null);
Expand Down

0 comments on commit 9ddbd6f

Please sign in to comment.