mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-12 20:49:50 +00:00
Added tests to thown in connect.
This commit is contained in:
parent
8c29847c8f
commit
2bed6622fe
1 changed files with 24 additions and 0 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue