You are here

protected function SolrBackendTestBase::clearIndex in Search API Solr 8.3

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/SolrBackendTestBase.php \Drupal\Tests\search_api_solr\Kernel\SolrBackendTestBase::clearIndex()
  2. 4.x tests/src/Kernel/SolrBackendTestBase.php \Drupal\Tests\search_api_solr\Kernel\SolrBackendTestBase::clearIndex()

Clears the test index.

Overrides BackendTestBase::clearIndex

2 calls to SolrBackendTestBase::clearIndex()
SearchApiSolrTest::checkBackendSpecificFeatures in tests/src/Kernel/SearchApiSolrTest.php
Checks backend specific features.
SolrBackendTestBase::tearDown in tests/src/Kernel/SolrBackendTestBase.php
Clear the index after every test.

File

tests/src/Kernel/SolrBackendTestBase.php, line 131

Class

SolrBackendTestBase
Tests location searches and distance facets using the Solr search backend.

Namespace

Drupal\Tests\search_api_solr\Kernel

Code

protected function clearIndex() {
  $index = Index::load($this->indexId);
  $index
    ->clear();
  $this
    ->ensureCommit($index);
}