You are here

protected function TestPluginTrait::logMethodCall in Search API 8

Logs a method call to the site state.

Parameters

string $method: The name of the called method.

array $args: (optional) The method arguments.

20 calls to TestPluginTrait::logMethodCall()
TestBackend::checkError in tests/search_api_test/src/Plugin/search_api/backend/TestBackend.php
TestProcessor::alterIndexedItems in tests/search_api_test/src/Plugin/search_api/processor/TestProcessor.php
Alter the items to be indexed.
TestProcessor::postprocessSearchResults in tests/search_api_test/src/Plugin/search_api/processor/TestProcessor.php
Postprocess search results before they are returned by the query.
TestProcessor::preIndexSave in tests/search_api_test/src/Plugin/search_api/processor/TestProcessor.php
Preprocesses the search index entity before it is saved.
TestProcessor::preprocessIndexItems in tests/search_api_test/src/Plugin/search_api/processor/TestProcessor.php
Preprocesses search items for indexing.

... See full list

File

tests/search_api_test/src/TestPluginTrait.php, line 44

Class

TestPluginTrait
Provides common functionality for test plugins.

Namespace

Drupal\search_api_test

Code

protected function logMethodCall($method, array $args = []) {
  $type = $this
    ->getPluginType();
  $state = \Drupal::state();

  // Log call.
  $key = "search_api_test.{$type}.methods_called";
  $methods_called = $state
    ->get($key, []);
  $methods_called[] = $method;
  $state
    ->set($key, $methods_called);

  // Log arguments.
  $key = "search_api_test.{$type}.method_arguments.{$method}";
  $state
    ->set($key, $args);
}