Skip to content
Permalink
Browse files

Make test a bit more solid.

  • Loading branch information...
markstory committed Sep 1, 2012
1 parent 571c8bc commit 072991d0da9430d0e9632330618c56cae1f0b988
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/Cake/Test/Case/Network/CakeSocketTest.php
@@ -179,11 +179,18 @@ public function testTimeOutConnection() {
$config = array('host' => '127.0.0.1', 'timeout' => 0.5);
$this->Socket = new CakeSocket($config);
$this->assertTrue($this->Socket->connect());
}
/**
* test timing out raises exception
*
* @expectedException SocketException
* @expectedExceptionMessage Operation timed out
*/
public function testTimeOutThrowException() {
$config = array('host' => '127.0.0.1', 'timeout' => 0.00001);
$this->Socket = new CakeSocket($config);
$this->assertFalse($this->Socket->read(1024 * 1024));
$this->assertEquals('2: ' . __d('cake_dev', 'Connection timed out'), $this->Socket->lastError());
$this->Socket->read(1024 * 1024);
}
/**

0 comments on commit 072991d

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