Example #1
0
 /**
  * @expectedException \Elastica\Exception\ResponseException
  */
 public function testInvalidElasticRequest()
 {
     $connection = new Connection();
     $connection->setHost('localhost');
     $connection->setPort(9500);
     $connection->setTransport('Thrift');
     $client = new Client();
     $client->addConnection($connection);
     $index = new Index($client, 'missing_index');
     $index->getStatus();
 }
Example #2
0
 /**
  * @group functional
  * @expectedException \Elastica\Exception\ResponseException
  */
 public function testInvalidElasticRequest()
 {
     $this->_checkPlugin();
     $connection = new Connection();
     $connection->setHost($this->_getHost());
     $connection->setPort(9500);
     $connection->setTransport('Thrift');
     $client = $this->_getClient();
     $client->addConnection($connection);
     $index = new Index($client, 'missing_index');
     $index->getStatus();
 }
Example #3
0
 protected function _waitForAllocation(Index $index)
 {
     do {
         $settings = $index->getStatus()->get();
         $allocated = true;
         foreach ($settings['shards'] as $shard) {
             if ($shard[0]['routing']['state'] != 'STARTED') {
                 $allocated = false;
             }
         }
     } while (!$allocated);
 }