You are here

protected function IntegrationTest::checkServerAvailability in Search API 8

Tests the server availability.

1 call to IntegrationTest::checkServerAvailability()
IntegrationTest::testFramework in tests/src/Functional/IntegrationTest.php
Tests various operations via the Search API's admin UI.

File

tests/src/Functional/IntegrationTest.php, line 507

Class

IntegrationTest
Tests the overall functionality of the Search API framework and admin UI.

Namespace

Drupal\Tests\search_api\Functional

Code

protected function checkServerAvailability() {
  $this
    ->drupalGet('admin/config/search/search-api/server/' . $this->serverId . '/edit');
  $this
    ->drupalGet('admin/config/search/search-api');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->responseContains('Enabled');
  $this
    ->setReturnValue('backend', 'isAvailable', FALSE);
  $this
    ->drupalGet('admin/config/search/search-api');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->responseContains('Unavailable');
  $this
    ->setReturnValue('backend', 'isAvailable', TRUE);
}