You are here

protected function PluginTestTrait::setMethodOverride in Search API 8

Overrides a method for a certain plugin.

Parameters

string $plugin_type: The "short" plugin type.

string $method: The name of the method to override.

callable|null $override: The new code of the method, or NULL to use the default.

4 calls to PluginTestTrait::setMethodOverride()
ConfigOverrideIntegrationTest::testConfigOverrideIntegration in tests/src/Functional/ConfigOverrideIntegrationTest.php
Tests that the UI works correctly with config entity overrides present.
ConfigOverrideKernelTest::testIndexSave in tests/src/Kernel/ConfigEntity/ConfigOverrideKernelTest.php
Checks whether saving an index with overrides works correctly.
ConfigOverrideKernelTest::testServerSave in tests/src/Kernel/ConfigEntity/ConfigOverrideKernelTest.php
Checks whether saving a server with overrides works correctly.
IndexChangesTest::testDatasourceRemoved in tests/src/Kernel/Index/IndexChangesTest.php
Tests correct reactions when a datasource is removed.

File

tests/search_api_test/src/PluginTestTrait.php, line 53

Class

PluginTestTrait
Provides functionality for tests that deal with test plugins.

Namespace

Drupal\search_api_test

Code

protected function setMethodOverride($plugin_type, $method, callable $override = NULL) {
  $key = "search_api_test.{$plugin_type}.method.{$method}";
  \Drupal::state()
    ->set($key, $override);
}