You are here

protected function BackendTest::checkUnknownOperator in Search API 8

Checks that an unknown operator throws an exception.

1 call to BackendTest::checkUnknownOperator()
BackendTest::checkBackendSpecificFeatures in modules/search_api_db/tests/src/Kernel/BackendTest.php
Checks backend specific features.

File

modules/search_api_db/tests/src/Kernel/BackendTest.php, line 500

Class

BackendTest
Tests index and search capabilities using the Database search backend.

Namespace

Drupal\Tests\search_api_db\Kernel

Code

protected function checkUnknownOperator() {
  try {
    $this
      ->buildSearch()
      ->addCondition('id', 1, '!=')
      ->execute();
    $this
      ->fail('Unknown operator "!=" did not throw an exception.');
  } catch (SearchApiException $e) {
    $this
      ->assertTrue(TRUE, 'Unknown operator "!=" threw an exception.');
  }
}