diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
commit | a2190ac74dd4d7080b12bab90e552d7aa81209ef (patch) | |
tree | 8b31f38de9882d18df54cf8d9e0de74167a094eb /vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php | |
parent | 15e69f7b20b6596b9148030acce5b59993b95a45 (diff) | |
parent | 257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff) |
Merge branch 'mw-1.26'
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php')
-rw-r--r-- | vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php index 10886b2d..812f141e 100644 --- a/vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php +++ b/vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php @@ -1,5 +1,4 @@ <?php - namespace Elastica\Test\Node; use Elastica\Node; @@ -8,6 +7,9 @@ use Elastica\Test\Base as BaseTest; class InfoTest extends BaseTest { + /** + * @group functional + */ public function testGet() { $client = $this->_getClient(); @@ -22,11 +24,14 @@ class InfoTest extends BaseTest // Load os infos $info = new NodeInfo($node, array('os')); - $this->assertTrue(!is_null($info->get('os', 'mem', 'total_in_bytes'))); + $this->assertNotNull($info->get('os', 'mem', 'total_in_bytes')); $this->assertInternalType('array', $info->get('os', 'mem')); $this->assertNull($info->get('test', 'notest', 'notexist')); } + /** + * @group functional + */ public function testHasPlugin() { $client = $this->_getClient(); @@ -35,8 +40,40 @@ class InfoTest extends BaseTest $info = $node->getInfo(); $pluginName = 'mapper-attachments'; - + $this->assertTrue($info->hasPlugin($pluginName)); $this->assertFalse($info->hasPlugin('foo')); } + + /** + * @group functional + */ + public function testGetId() + { + $client = $this->_getClient(); + $nodes = $client->getCluster()->getNodes(); + + $ids = array(); + + foreach ($nodes as $node) { + $id = $node->getInfo()->getId(); + + // Checks that the ids are unique + $this->assertFalse(in_array($id, $ids)); + $ids[] = $id; + } + } + + /** + * @group functional + */ + public function testGetName() + { + $client = $this->_getClient(); + $nodes = $client->getCluster()->getNodes(); + + foreach ($nodes as $node) { + $this->assertEquals('Elastica', $node->getInfo()->getName()); + } + } } |