Skip to content
Permalink
Browse files

Removing dependancy on Object from CakeSocket. Making tests less depe…

…ndant on having a network connection.
  • Loading branch information...
markstory committed Apr 24, 2010
1 parent e8b6d45 commit 9ddbd6f68689e43668264443a55ff28b1df6da9f
Showing with 3 additions and 5 deletions.
  1. +1 −3 cake/libs/cake_socket.php
  2. +2 −2 cake/tests/cases/libs/cake_socket.test.php
@@ -27,7 +27,7 @@
* @package cake
* @subpackage cake.cake.libs
*/
class CakeSocket extends Object {
class CakeSocket {
/**
* Object description
@@ -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']);
@@ -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);

0 comments on commit 9ddbd6f

Please sign in to comment.
You can’t perform that action at this time.