You are here

protected function ElasticsearchTest::checkModuleUninstall in Elasticsearch Connector 8.5

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

Tests whether removing the configuration again works as it should.

Overrides BackendTest::checkModuleUninstall

File

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

Class

ElasticsearchTest
Tests index and search capabilities using the elasticsearch backend.

Namespace

Drupal\elasticsearch_connector\Tests\Kernel

Code

protected function checkModuleUninstall() {

  // See whether clearing the server works.
  // Regression test for #2156151.
  $server = Server::load($this->serverId);
  $index = Index::load($this->indexId);
  $server
    ->getBackend()
    ->removeIndex($index);
  $query = $this
    ->buildSearch();
  $results = $query
    ->execute();
  $this
    ->assertEqual($results
    ->getResultCount(), 0, 'Clearing the server worked correctly.');
}