/** * Tests toArray(). * * @param $query * @param $noMatchQuery * @param $expected * * @dataProvider getTestToArrayData() */ public function testToArray($query, $noMatchQuery, $expected) { $query = new IndicesQuery(['foo', 'bar'], $query, $noMatchQuery); $this->assertEquals(['indices' => $expected], $query->toArray()); }
/** * Test toArray() method when the number of indices > 1. * * @param Query $query Query for testing. * @param array $parameters Optional parameters. * @param array $expected Expected values. * * @dataProvider getArrayWithManyIndicesDataProvider */ public function testToArrayWithManyIndices($query, $parameters, $expected) { $query = new IndicesQuery($parameters, $query); $this->assertEquals($expected, $query->toArray()); }