Skip to content
This repository
Browse code

Make test a bit more solid.

  • Loading branch information...
commit 072991d0da9430d0e9632330618c56cae1f0b988 1 parent 571c8bc
Mark Story authored
11  lib/Cake/Test/Case/Network/CakeSocketTest.php
@@ -179,11 +179,18 @@ public function testTimeOutConnection() {
179 179
 		$config = array('host' => '127.0.0.1', 'timeout' => 0.5);
180 180
 		$this->Socket = new CakeSocket($config);
181 181
 		$this->assertTrue($this->Socket->connect());
  182
+	}
182 183
 
  184
+/**
  185
+ * test timing out raises exception
  186
+ *
  187
+ * @expectedException SocketException
  188
+ * @expectedExceptionMessage Operation timed out
  189
+ */
  190
+	public function testTimeOutThrowException() {
183 191
 		$config = array('host' => '127.0.0.1', 'timeout' => 0.00001);
184 192
 		$this->Socket = new CakeSocket($config);
185  
-		$this->assertFalse($this->Socket->read(1024 * 1024));
186  
-		$this->assertEquals('2: ' . __d('cake_dev', 'Connection timed out'), $this->Socket->lastError());
  193
+		$this->Socket->read(1024 * 1024);
187 194
 	}
188 195
 
189 196
 /**

0 notes on commit 072991d

Please sign in to comment.
Something went wrong with that request. Please try again.