You are here

protected function BackendTest::setServerMatchMode in Search API 8

Edits the server to sets the match mode.

Parameters

string $match_mode: The matching mode to set – "words", "partial" or "prefix".

Throws

\Drupal\Core\Entity\EntityStorageException

3 calls to BackendTest::setServerMatchMode()
BackendTest::checkBackendSpecificFeatures in modules/search_api_db/tests/src/Kernel/BackendTest.php
Checks backend specific features.
BackendTest::regressionTest2916534 in modules/search_api_db/tests/src/Kernel/BackendTest.php
Tests edge cases for partial matching.
BackendTest::testRegression2949962 in modules/search_api_db/tests/src/Kernel/BackendTest.php
Tests negated fulltext searches with substring matching.

File

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

Class

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

Namespace

Drupal\Tests\search_api_db\Kernel

Code

protected function setServerMatchMode($match_mode = 'partial') {
  $server = $this
    ->getServer();
  $backend_config = $server
    ->getBackendConfig();
  $backend_config['matching'] = $match_mode;
  $server
    ->setBackendConfig($backend_config);
  $this
    ->assertTrue((bool) $server
    ->save(), 'The server was successfully edited.');
  $this
    ->resetEntityCache();
}