Skip to content

Commit

Permalink
test connection error (#1546)
Browse files Browse the repository at this point in the history
  • Loading branch information
p365labs authored and ruflin committed Dec 6, 2018
1 parent aa1836b commit 029731d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/Elastica/ClientTest.php
Expand Up @@ -31,6 +31,36 @@ public function testConstruct()
$this->assertCount(1, $client->getConnections());
}

/**
* @group functional
* @expectedException Elastica\Exception\Connection\HttpException
*/
public function testConnectionErrors()
{
$client = $this->_getClient(['host' => 'foo.bar', 'port' => '9201']);
$client->getVersion();
}

/**
* @group functional
* @expectedException Elastica\Exception\Connection\HttpException
*/
public function testClientBadHost()
{
$client = $this->_getClient(['host' => 'localhost', 'port' => '9201']);
$client->getVersion();
}

/**
* @group functional
* @expectedException Elastica\Exception\Connection\HttpException
*/
public function testClientBadHostWithtimeout()
{
$client = $this->_getClient(['host' => 'foo.bar', 'timeout' => 10]);
$client->getVersion();
}

/**
* @group functional
*/
Expand Down

0 comments on commit 029731d

Please sign in to comment.