summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/test/lib/Elastica/Test/StatusTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/StatusTest.php')
-rw-r--r--vendor/ruflin/elastica/test/lib/Elastica/Test/StatusTest.php33
1 files changed, 25 insertions, 8 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/StatusTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/StatusTest.php
index 14d7950a..fe6bb091 100644
--- a/vendor/ruflin/elastica/test/lib/Elastica/Test/StatusTest.php
+++ b/vendor/ruflin/elastica/test/lib/Elastica/Test/StatusTest.php
@@ -1,13 +1,15 @@
<?php
-
namespace Elastica\Test;
-use Elastica\Client;
+
use Elastica\Exception\ResponseException;
use Elastica\Status;
use Elastica\Test\Base as BaseTest;
class StatusTest extends BaseTest
{
+ /**
+ * @group functional
+ */
public function testGetResponse()
{
$index = $this->_createIndex();
@@ -15,6 +17,9 @@ class StatusTest extends BaseTest
$this->assertInstanceOf('Elastica\Response', $status->getResponse());
}
+ /**
+ * @group functional
+ */
public function testGetIndexStatuses()
{
$index = $this->_createIndex();
@@ -29,6 +34,9 @@ class StatusTest extends BaseTest
}
}
+ /**
+ * @group functional
+ */
public function testGetIndexNames()
{
$indexName = 'test';
@@ -36,8 +44,8 @@ class StatusTest extends BaseTest
$index = $client->getIndex($indexName);
$index->create(array(), true);
$index = $this->_createIndex();
- $index->refresh();
- $index->optimize();
+ $index->refresh();
+ $index->optimize();
$status = new Status($index->getClient());
$names = $status->getIndexNames();
@@ -50,6 +58,9 @@ class StatusTest extends BaseTest
}
}
+ /**
+ * @group functional
+ */
public function testIndexExists()
{
$indexName = 'elastica_test';
@@ -72,12 +83,15 @@ class StatusTest extends BaseTest
$this->assertTrue($status->indexExists($indexName));
}
+ /**
+ * @group functional
+ */
public function testAliasExists()
{
- $indexName = 'test';
$aliasName = 'elastica_test-alias';
$index1 = $this->_createIndex();
+ $indexName = $index1->getName();
$status = new Status($index1->getClient());
@@ -92,19 +106,22 @@ class StatusTest extends BaseTest
$this->assertTrue($status->aliasExists($aliasName));
$indicesWithAlias = $status->getIndicesWithAlias($aliasName);
- $this->assertEquals(array("elastica_$indexName"), array_map(
- function($index) {
+ $this->assertEquals(array($indexName), array_map(
+ function ($index) {
return $index->getName();
}, $indicesWithAlias));
}
+ /**
+ * @group functional
+ */
public function testServerStatus()
{
$client = $this->_getClient();
$status = $client->getStatus();
$serverStatus = $status->getServerStatus();
- $this->assertTrue(!empty($serverStatus) );
+ $this->assertTrue(!empty($serverStatus));
$this->assertTrue('array' == gettype($serverStatus));
$this->assertArrayHasKey('status', $serverStatus);
$this->assertTrue($serverStatus['status'] == 200);