/** * @group unit */ public function testAddIndex() { $client = $this->_getClient(); $index = $client->getIndex('someindex'); $query = new Indices(new Term(array('color' => 'blue')), array()); $query->addIndex($index); $expected = array($index->getName()); $this->assertEquals($expected, $query->getParam('indices')); $query->addIndex('foo'); $expected = array($index->getName(), 'foo'); $this->assertEquals($expected, $query->getParam('indices')); $returnValue = $query->addIndex('bar'); $this->assertInstanceOf('Elastica\\Query\\Indices', $returnValue); }