Skip to content

Commit

Permalink
Added tests to thown in connect.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Nov 9, 2010
1 parent 8c29847 commit 2bed662
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cake/tests/cases/libs/cake_socket.test.php
Expand Up @@ -101,6 +101,30 @@ function testSocketConnection() {
$this->assertTrue($this->Socket->connected);
}

/**
* data provider function for testInvalidConnection
*
* @return array
*/
public static function invalidConnections() {
return array(
array(array('host' => 'invalid.host')),
array(array('host' => '127.0.0.1', 'port' => '70000'))
);
}

/**
* testInvalidConnection method
*
* @dataProvider invalidConnections
* @expectedException Exception
* return void
*/
public function testInvalidConnection($data) {
$this->Socket->config = array_merge($this->Socket->config, $data);
$this->Socket->connect();
}

/**
* testSocketHost method
*
Expand Down

0 comments on commit 2bed662

Please sign in to comment.