You are here

protected function SearchApiDbTest::editServerPartial in Search API Database Search 7

Edits the server to enable partial matches.

Parameters

bool $enable: (optional) Whether partial matching should be enabled or disabled.

2 calls to SearchApiDbTest::editServerPartial()
SearchApiDbTest::regressionTests in ./search_api_db.test
Executes regression tests for issues that were already fixed.
SearchApiDbTest::testFramework in ./search_api_db.test

File

./search_api_db.test, line 492

Class

SearchApiDbTest
Class for testing index and search capabilities using the Database search module.

Code

protected function editServerPartial($enable = TRUE) {
  $server = search_api_server_load($this->server_id, TRUE);
  $server->options['partial_matches'] = $enable;
  $success = (bool) $server
    ->save();
  $this
    ->assertTrue($success, 'The server was successfully edited.');

  // Reset the internal cache so the index won't use the old server.
  search_api_index_load($this->index_id, TRUE);
}