You are here

public function SearchApiBrowserTestBase::getTestServer in Search API 8

Creates or loads a server.

Return value

\Drupal\search_api\ServerInterface A search server.

6 calls to SearchApiBrowserTestBase::getTestServer()
EventsTest::setUp in tests/src/Functional/EventsTest.php
HooksTest::setUp in tests/src/Functional/HooksTest.php
LanguageIntegrationTest::setUp in tests/src/Functional/LanguageIntegrationTest.php
OverviewPageTest::checkOperations in tests/src/Functional/OverviewPageTest.php
Tests server operations in the overview page.
OverviewPageTest::checkServerAndIndexCreation in tests/src/Functional/OverviewPageTest.php
Tests the creation of a server and an index.

... See full list

File

tests/src/Functional/SearchApiBrowserTestBase.php, line 145

Class

SearchApiBrowserTestBase
Provides the base class for web tests for Search API.

Namespace

Drupal\Tests\search_api\Functional

Code

public function getTestServer() {
  $server = Server::load('webtest_server');
  if (!$server) {
    $server = Server::create([
      'id' => 'webtest_server',
      'name' => 'WebTest server',
      'description' => 'WebTest server description',
      'backend' => 'search_api_test',
      'backend_config' => [],
    ]);
    $server
      ->save();
  }
  return $server;
}