From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- .../test/lib/Elastica/Test/Node/InfoTest.php | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php') diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php new file mode 100644 index 00000000..812f141e --- /dev/null +++ b/vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php @@ -0,0 +1,79 @@ +_getClient(); + $names = $client->getCluster()->getNodeNames(); + $name = reset($names); + + $node = new Node($name, $client); + $info = new NodeInfo($node); + + $this->assertNull($info->get('os', 'mem', 'total')); + + // Load os infos + $info = new NodeInfo($node, array('os')); + + $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(); + $nodes = $client->getCluster()->getNodes(); + $node = $nodes[0]; + $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()); + } + } +} -- cgit v1.2.3-54-g00ecf