You are here

protected function SearchApiSolrTest::checkModuleUninstall in Search API Solr 8.3

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

Tests whether removing the configuration again works as it should.

Overrides SolrBackendTestBase::checkModuleUninstall

File

tests/src/Kernel/SearchApiSolrTest.php, line 197

Class

SearchApiSolrTest
Tests index and search capabilities using the Solr search backend.

Namespace

Drupal\Tests\search_api_solr\Kernel

Code

protected function checkModuleUninstall() {
  $this->travisLogger
    ->debug('SearchApiSolrTest::checkModuleUninstall()');

  // See whether clearing the server works.
  // Regression test for #2156151.

  /** @var \Drupal\search_api\ServerInterface $server */
  $server = Server::load($this->serverId);

  /** @var \Drupal\search_api\IndexInterface $index */
  $index = Index::load($this->indexId);
  $server
    ->deleteAllIndexItems($index);
  $this
    ->ensureCommit($index);
  $query = $this
    ->buildSearch();
  $results = $query
    ->execute();
  $this
    ->assertEquals(0, $results
    ->getResultCount(), 'Clearing the server worked correctly.');
}