summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php')
-rw-r--r--vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php75
1 files changed, 75 insertions, 0 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php
new file mode 100644
index 00000000..fbd2d297
--- /dev/null
+++ b/vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php
@@ -0,0 +1,75 @@
+<?php
+namespace Elastica\Test;
+
+use Elastica\Node;
+use Elastica\Test\Base as BaseTest;
+
+class NodeTest extends BaseTest
+{
+ /**
+ * @group functional
+ */
+ public function testCreateNode()
+ {
+ $client = $this->_getClient();
+ $names = $client->getCluster()->getNodeNames();
+ $name = reset($names);
+
+ $node = new Node($name, $client);
+ $this->assertInstanceOf('Elastica\Node', $node);
+ }
+
+ /**
+ * @group functional
+ */
+ public function testGetInfo()
+ {
+ $client = $this->_getClient();
+ $names = $client->getCluster()->getNodeNames();
+ $name = reset($names);
+
+ $node = new Node($name, $client);
+
+ $info = $node->getInfo();
+
+ $this->assertInstanceOf('Elastica\Node\Info', $info);
+ }
+
+ /**
+ * @group functional
+ */
+ public function testGetStats()
+ {
+ $client = $this->_getClient();
+ $names = $client->getCluster()->getNodeNames();
+ $name = reset($names);
+
+ $node = new Node($name, $client);
+
+ $stats = $node->getStats();
+
+ $this->assertInstanceOf('Elastica\Node\Stats', $stats);
+ }
+
+ /**
+ * @group functional
+ */
+ public function testGetName()
+ {
+ $nodes = $this->_getClient()->getCluster()->getNodes();
+ // At least 1 instance must exist
+ $this->assertGreaterThan(0, $nodes);
+
+ foreach ($nodes as $node) {
+ $this->assertEquals($node->getName(), 'Elastica');
+ }
+ }
+
+ /**
+ * @group functional
+ */
+ public function testGetId()
+ {
+ $node = new Node('Elastica', $this->_getClient());
+ }
+}