protected function getLastIndexName() { try { $indices = $this->client->indices()->getAlias(['name' => $this->getIndexName()]); return IndexNameResolver::getLastIndexName(array_keys($indices)); } catch (Missing404Exception $e) { return null; } }
/** * @covers \Keboola\Syrup\Elasticsearch\IndexNameResolver::getLastIndexname * @dataProvider resolutionData */ public function testLastIndexNameResolution($expected, $indices) { $this->assertEquals($expected, IndexNameResolver::getLastIndexName($indices)); }