public function testConstruct() { $configuration = new TestConfiguration(new TestDataProvider()); $indexName = $configuration->getName(); $indexManager = new IndexManager($this->client, $configuration, $indexName); $this->assertEquals($this->indexManager, $indexManager); $this->assertEquals($this->client, $indexManager->getClient()); $this->assertEquals($configuration, $indexManager->getConfiguration()); $this->assertEquals($indexName, $indexManager->getIndexName()); // Test different name than default one $indexName = $configuration->getName() . '_special'; $indexManager = new IndexManager($this->client, $configuration, $indexName); $this->assertEquals($indexName, $indexManager->getIndexName()); }
/** * @param string|null $indexName * @return IndexManager */ protected function _getIndexManager($indexName = null) { $configuration = new TestConfiguration(new TestDataProvider()); $indexName = $indexName ?: $configuration->getName(); return new IndexManager($this->client, $configuration, $indexName); }