You are here

protected function ElasticsearchTest::clearIndex in Elasticsearch Connector 8.6

Same name and namespace in other branches
  1. 8.7 tests/src/Kernel/ElasticsearchTest.php \Drupal\elasticsearch_connector\Tests\Kernel\ElasticsearchTest::clearIndex()
  2. 8.5 tests/src/Kernel/ElasticsearchTest.php \Drupal\elasticsearch_connector\Tests\Kernel\ElasticsearchTest::clearIndex()

Clears the test index.

Overrides BackendTestBase::clearIndex

File

tests/src/Kernel/ElasticsearchTest.php, line 100

Class

ElasticsearchTest
Tests index and search capabilities using the elasticsearch backend.

Namespace

Drupal\elasticsearch_connector\Tests\Kernel

Code

protected function clearIndex() {
  $server = Server::load($this->serverId);
  $index = Index::load($this->indexId);
  $server
    ->getBackend()
    ->removeIndex($index);
}