Added tests to thown in connect.

This commit is contained in:
Juan Basso 2010-11-09 21:00:57 -02:00
parent 8c29847c8f
commit 2bed6622fe

View file

@ -101,6 +101,30 @@ class CakeSocketTest extends CakeTestCase {
$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
*