summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/test/lib/Elastica/Test/ClusterTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/ClusterTest.php')
-rw-r--r--vendor/ruflin/elastica/test/lib/Elastica/Test/ClusterTest.php42
1 files changed, 18 insertions, 24 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/ClusterTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/ClusterTest.php
index ae5fb980..ebd89f01 100644
--- a/vendor/ruflin/elastica/test/lib/Elastica/Test/ClusterTest.php
+++ b/vendor/ruflin/elastica/test/lib/Elastica/Test/ClusterTest.php
@@ -1,26 +1,28 @@
<?php
-
namespace Elastica\Test;
-use Elastica\Client;
use Elastica\Cluster;
use Elastica\Test\Base as BaseTest;
class ClusterTest extends BaseTest
{
-
+ /**
+ * @group functional
+ */
public function testGetNodeNames()
{
$client = $this->_getClient();
$cluster = new Cluster($client);
- $names = $cluster->getNodeNames();
-
- $this->assertInternalType('array', $names);
- $this->assertGreaterThan(0, count($names));
+ foreach ($cluster->getNodeNames() as $name) {
+ $this->assertEquals('Elastica', $name);
+ }
}
+ /**
+ * @group functional
+ */
public function testGetNodes()
{
$client = $this->_getClient();
@@ -35,6 +37,9 @@ class ClusterTest extends BaseTest
$this->assertGreaterThan(0, count($nodes));
}
+ /**
+ * @group functional
+ */
public function testGetState()
{
$client = $this->_getClient();
@@ -44,28 +49,14 @@ class ClusterTest extends BaseTest
}
/**
- * @expectedException \Elastica\Exception\ConnectionException
+ * @group functional
*/
- public function testShutdown()
- {
- $this->markTestSkipped('This test shuts down the cluster which means the following tests would not work');
- $client = $this->_getClient();
- $cluster = $client->getCluster();
-
- $cluster->shutdown('2s');
-
- sleep(5);
-
- $client->getStatus();
- }
-
public function testGetIndexNames()
{
$client = $this->_getClient();
$cluster = $client->getCluster();
- $indexName = 'elastica_test999';
- $index = $this->_createIndex($indexName);
+ $index = $this->_createIndex();
$index->delete();
$cluster->refresh();
@@ -73,7 +64,7 @@ class ClusterTest extends BaseTest
$indexNames = $cluster->getIndexNames();
$this->assertNotContains($index->getName(), $indexNames);
- $index = $this->_createIndex($indexName);
+ $index = $this->_createIndex();
$cluster->refresh();
// Now index should exist
@@ -81,6 +72,9 @@ class ClusterTest extends BaseTest
$this->assertContains($index->getname(), $indexNames);
}
+ /**
+ * @group functional
+ */
public function testGetHealth()
{
$client = $this->_getClient();