You are here

public static function MethodOverrides::overrideTestBackendMethod in Search API 8

Provides a generic method override for the test backend.

Parameters

\Drupal\search_api\Backend\BackendInterface $backend: The backend plugin on which the method was called.

Return value

true Always returns TRUE, to cater to those methods that expect a return value.

File

tests/search_api_test/src/MethodOverrides.php, line 23

Class

MethodOverrides
Holds method overrides for test plugins.

Namespace

Drupal\search_api_test

Code

public static function overrideTestBackendMethod(BackendInterface $backend) {
  if ($backend
    ->getConfiguration() !== [
    'test' => 'foobar',
  ]) {
    trigger_error('Critical server method called with incorrect backend configuration.', E_USER_ERROR);
  }
  return TRUE;
}