getNodeNames() public method

Returns a list of existing node names.
public getNodeNames ( ) : array
return array List of node names
Esempio n. 1
0
 /**
  * @group functional
  */
 public function testGetNodeNames()
 {
     $client = $this->_getClient();
     $cluster = new Cluster($client);
     foreach ($cluster->getNodeNames() as $name) {
         $this->assertEquals('Elastica', $name);
     }
 }
 public function testGetNodeNames()
 {
     $client = $this->_getClient();
     $cluster = new Cluster($client);
     $names = $cluster->getNodeNames();
     $this->assertInternalType('array', $names);
     $this->assertGreaterThan(0, count($names));
 }
 /**
  * @group functional
  */
 public function testGetNodeNames()
 {
     $client = $this->_getClient();
     $data = $client->request('/')->getData();
     $cluster = new Cluster($client);
     $data = $client->request('/_nodes')->getData();
     $rawNodes = $data['nodes'];
     $rawNodeNames = array();
     foreach ($rawNodes as $rawNode) {
         $rawNodeNames[] = $rawNode['name'];
     }
     $this->assertEquals($rawNodeNames, $cluster->getNodeNames());
 }