[tests] Do not check exception message for connection timeouts.

Given the IP address we use for this test (the standard IP assigned by
operating systems when unable to get one lease from a DHCP server), on
certain kernels or network stacks we can get different messages such
as "No route to host". Since we just need to make sure that our test
does not take more than 1 seconds abiding by the sub-second timeout,
we can just live with that.
This commit is contained in:
Daniele Alessandri
2013-11-07 12:19:23 +01:00
parent 463f2d655c
commit 66f98186f0
+1 -8
View File
@@ -281,17 +281,10 @@ abstract class ConnectionTestCase extends StandardTestCase
/**
* @group connected
* @group slow
* @expectedException Predis\Connection\ConnectionException
*/
public function testThrowsExceptionOnConnectionTimeout()
{
// We must differentiate here since OS X can randomly emit up to three
// different error messages while other platforms are more consistent.
if (strcasecmp(PHP_OS, 'darwin') == 0) {
$this->setExpectedException('Predis\Connection\ConnectionException');
} else {
$this->setExpectedException('Predis\Connection\ConnectionException', 'Connection timed out');
}
$connection = $this->getConnection($_, false, array('host' => '169.254.10.10', 'timeout' => 0.5));
$connection->connect();