Browse Source

Fix AppVeyor builds

The class imports were incorrect, and tests were failing on AppVeyor.
mark_story 11 years ago
parent
commit
21b7029d8c

+ 2 - 2
tests/TestCase/Network/Http/Adapter/StreamTest.php

@@ -13,7 +13,7 @@
  */
 namespace Cake\Test\TestCase\Network\Http\Adapter;
 
-use Cake\Error;
+use Cake\Network\Exception\SocketException;
 use Cake\Network\Http\Adapter\Stream;
 use Cake\Network\Http\Request;
 use Cake\Network\Http\Response;
@@ -46,7 +46,7 @@ class StreamTest extends TestCase {
 
 		try {
 			$responses = $stream->send($request, []);
-		} catch (Error\Exception $e) {
+		} catch (SocketException $e) {
 			$this->markTestSkipped('Could not connect to localhost, skipping');
 		}
 		$this->assertInstanceOf('Cake\Network\Http\Response', $responses[0]);

+ 7 - 7
tests/TestCase/Network/SocketTest.php

@@ -14,7 +14,7 @@
  */
 namespace Cake\Test\TestCase\Network;
 
-use Cake\Network\Error\SocketException;
+use Cake\Network\Exception\SocketException;
 use Cake\Network\Socket;
 use Cake\TestSuite\TestCase;
 
@@ -95,7 +95,7 @@ class SocketTest extends TestCase {
 			$this->Socket = new Socket($config);
 			$this->Socket->connect();
 			$this->assertTrue($this->Socket->connected);
-		} catch (Cake\Network\Exception\SocketException $e) {
+		} catch (SocketException $e) {
 			$this->markTestSkipped('Cannot test network, skipping.');
 		}
 	}
@@ -144,7 +144,7 @@ class SocketTest extends TestCase {
 			$this->assertEquals(gethostbyaddr('127.0.0.1'), $this->Socket->host());
 			$this->assertEquals(null, $this->Socket->lastError());
 			$this->assertTrue(in_array('127.0.0.1', $this->Socket->addresses()));
-		} catch (Cake\Network\Exception\SocketException $e) {
+		} catch (SocketException $e) {
 			$this->markTestSkipped('Cannot test network, skipping.');
 		}
 	}
@@ -158,7 +158,7 @@ class SocketTest extends TestCase {
 		try {
 			$request = "GET / HTTP/1.1\r\nConnection: close\r\n\r\n";
 			$this->assertTrue((bool)$this->Socket->write($request));
-		} catch (Cake\Network\Exception\SocketException $e) {
+		} catch (SocketException $e) {
 			$this->markTestSkipped('Cannot test network, skipping.');
 		}
 	}
@@ -179,7 +179,7 @@ class SocketTest extends TestCase {
 			$this->assertTrue($this->Socket->connect());
 			$this->assertEquals(null, $this->Socket->read(26));
 			$this->assertEquals('2: ' . 'Connection timed out', $this->Socket->lastError());
-		} catch (Cake\Network\Exception\SocketException $e) {
+		} catch (SocketException $e) {
 			$this->markTestSkipped('Cannot test network, skipping.');
 		}
 	}
@@ -199,7 +199,7 @@ class SocketTest extends TestCase {
 			$this->Socket = new Socket($config);
 			$this->assertFalse($this->Socket->read(1024 * 1024));
 			$this->assertEquals('2: ' . 'Connection timed out', $this->Socket->lastError());
-		} catch (Cake\Network\Exception\SocketException $e) {
+		} catch (SocketException $e) {
 			$this->markTestSkipped('Cannot test network, skipping.');
 		}
 	}
@@ -287,7 +287,7 @@ class SocketTest extends TestCase {
 		$this->Socket = new Socket($configSslTls);
 		try {
 			$this->Socket->connect();
-		} catch (Cake\Network\Exception\SocketException $e) {
+		} catch (SocketException $e) {
 			$this->markTestSkipped('Cannot test network, skipping.');
 		}
 	}