You are here

protected function BackendTestBase::resetEntityCache in Search API 8

Resets the entity cache for the specified entity.

Parameters

string $type: (optional) The type of entity whose cache should be reset. Either "index" or "server".

3 calls to BackendTestBase::resetEntityCache()
BackendTest::editServerMinChars in modules/search_api_db/tests/src/Kernel/BackendTest.php
Edits the server to change the "Minimum word length" setting.
BackendTest::setServerMatchMode in modules/search_api_db/tests/src/Kernel/BackendTest.php
Edits the server to sets the match mode.
BackendTestBase::regressionTest1916474 in tests/src/Kernel/BackendTestBase.php
Regression tests for correctly indexing multiple float/decimal fields.

File

tests/src/Kernel/BackendTestBase.php, line 1173

Class

BackendTestBase
Provides a base class for backend tests.

Namespace

Drupal\Tests\search_api\Kernel

Code

protected function resetEntityCache($type = 'index') {
  $entity_type_id = 'search_api_' . $type;
  \Drupal::entityTypeManager()
    ->getStorage($entity_type_id)
    ->resetCache([
    $this->{$type . 'Id'},
  ]);
}