diff options
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Transport/ThriftTest.php')
-rw-r--r-- | vendor/ruflin/elastica/test/lib/Elastica/Test/Transport/ThriftTest.php | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Transport/ThriftTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Transport/ThriftTest.php index f1698ff6..b73ef4f7 100644 --- a/vendor/ruflin/elastica/test/lib/Elastica/Test/Transport/ThriftTest.php +++ b/vendor/ruflin/elastica/test/lib/Elastica/Test/Transport/ThriftTest.php @@ -1,12 +1,9 @@ <?php - namespace Elastica\Test\Transport; -use Elastica\Client; use Elastica\Connection; use Elastica\Document; use Elastica\Index; -use Elastica\Query; use Elastica\Test\Base as BaseTest; class ThriftTest extends BaseTest @@ -18,17 +15,21 @@ class ThriftTest extends BaseTest } } + /** + * @group unit + */ public function testConstruct() { - $host = 'localhost'; + $host = $this->_getHost(); $port = 9500; - $client = new Client(array('host' => $host, 'port' => $port, 'transport' => 'Thrift')); + $client = $this->_getClient(array('host' => $host, 'port' => $port, 'transport' => 'Thrift')); $this->assertEquals($host, $client->getConnection()->getHost()); $this->assertEquals($port, $client->getConnection()->getPort()); } /** + * @group functional * @dataProvider configProvider */ public function testSearchRequest($config) @@ -36,7 +37,7 @@ class ThriftTest extends BaseTest $this->_checkPlugin(); // Creates a new index 'xodoa' and a type 'user' inside this index - $client = new Client($config); + $client = $this->_getClient($config); $index = $client->getIndex('elastica_test1'); $index->create(array(), true); @@ -68,17 +69,19 @@ class ThriftTest extends BaseTest } /** + * @group unit * @expectedException \Elastica\Exception\ConnectionException */ public function testInvalidHostRequest() { $this->_checkPlugin(); - $client = new Client(array('host' => 'unknown', 'port' => 9555, 'transport' => 'Thrift')); + $client = $this->_getClient(array('host' => 'unknown', 'port' => 9555, 'transport' => 'Thrift')); $client->getStatus(); } /** + * @group functional * @expectedException \Elastica\Exception\ResponseException */ public function testInvalidElasticRequest() @@ -86,11 +89,11 @@ class ThriftTest extends BaseTest $this->_checkPlugin(); $connection = new Connection(); - $connection->setHost('localhost'); + $connection->setHost($this->_getHost()); $connection->setPort(9500); $connection->setTransport('Thrift'); - $client = new Client(); + $client = $this->_getClient(); $client->addConnection($connection); $index = new Index($client, 'missing_index'); @@ -102,23 +105,23 @@ class ThriftTest extends BaseTest return array( array( array( - 'host' => 'localhost', + 'host' => $this->_getHost(), 'port' => 9500, - 'transport' => 'Thrift' - ) + 'transport' => 'Thrift', + ), ), array( array( - 'host' => 'localhost', + 'host' => $this->_getHost(), 'port' => 9500, 'transport' => 'Thrift', 'config' => array( 'framedTransport' => false, 'sendTimeout' => 10000, 'recvTimeout' => 20000, - ) - ) - ) + ), + ), + ), ); } @@ -126,7 +129,7 @@ class ThriftTest extends BaseTest { $nodes = $this->_getClient()->getCluster()->getNodes(); if (!$nodes[0]->getInfo()->hasPlugin('transport-thrift')) { - $this->markTestSkipped("transport-thrift plugin not installed."); + $this->markTestSkipped('transport-thrift plugin not installed.'); } } } |