diff options
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()); + } + } } |