diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-10-18 09:31:31 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-10-18 09:31:31 +0200 |
commit | 80f7dc77d430774192b929d780f96260066df2ee (patch) | |
tree | 102eaae7fc9ec567f2af76e96da3de2d1e83afcf /vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php | |
parent | cccd7bb4d819334c07e0dadaf16cbfdef31880e1 (diff) |
Update to MediaWiki 1.25.3
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php')
-rw-r--r-- | vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php deleted file mode 100644 index d70825d1..00000000 --- a/vendor/ruflin/elastica/test/lib/Elastica/Test/NodeTest.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -namespace Elastica\Test; - -use Elastica\Client; -use Elastica\Node; -use Elastica\Test\Base as BaseTest; - -class NodeTest extends BaseTest -{ - - public function testCreateNode() - { - $client = $this->_getClient(); - $names = $client->getCluster()->getNodeNames(); - $name = reset($names); - - $node = new Node($name, $client); - $this->assertInstanceOf('Elastica\Node', $node); - } - - 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); - } - - 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); - } - - /** - * Shuts one of two nodes down (if two available) - */ - public function testShutdown() - { - $this->markTestSkipped('At least two nodes have to be running, because 1 node is shutdown'); - $client = $this->_getClient(); - $nodes = $client->getCluster()->getNodes(); - - $count = count($nodes); - if ($count < 2) { - $this->markTestSkipped('At least two nodes have to be running, because 1 node is shutdown'); - } - - // Store node info of node with port 9200 for later - foreach ($nodes as $key => $node) { - if ($node->getInfo()->getPort() == 9200) { - $info = $node->getInfo(); - unset($nodes[$key]); - } - } - - // Select one of the not port 9200 nodes and shut it down - $node = array_shift($nodes); - $node->shutdown('2s'); - - // Wait until node is shutdown - sleep(5); - - // Use still existing node - $client = new Client(array('host' => $info->getIp(), 'port' => $info->getPort())); - $names = $client->getCluster()->getNodeNames(); - - // One node less ... - $this->assertEquals($count - 1, count($names)); - } -} |