You are here

protected static function TestsHelper::logMethodCall in Search API Autocomplete 8

Logs a method call to the site state.

Parameters

string $type: The type of plugin.

string $method: The name of the called method.

array $args: (optional) The method arguments.

2 calls to TestsHelper::logMethodCall()
TestsHelper::getAutocompleteSuggestions in src/Tests/TestsHelper.php
Retrieves autocompletion suggestions for some user input.
TestsHelper::search in src/Tests/TestsHelper.php
Executes a search on this server.

File

src/Tests/TestsHelper.php, line 114

Class

TestsHelper
Contains helper methods for running tests.

Namespace

Drupal\search_api_autocomplete\Tests

Code

protected static function logMethodCall($type, $method, array $args = []) {
  $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);
}