You are here

protected function SearchPageTest::SearchConfigs in Opigno Search 8

Same name and namespace in other branches
  1. 3.x tests/src/Functional/SearchPageTest.php \Drupal\Tests\opigno_learning_path\Functional\SearchPageTest::SearchConfigs()

Tests creating a search server via the UI.

1 call to SearchPageTest::SearchConfigs()
SearchPageTest::testSearchPageContent in tests/src/Functional/SearchPageTest.php
Tests search.

File

tests/src/Functional/SearchPageTest.php, line 56

Class

SearchPageTest
Tests for Search process.

Namespace

Drupal\Tests\opigno_learning_path\Functional

Code

protected function SearchConfigs() {
  $server_name = 'Database Server';
  $server_description = 'Default database server created by the Database Search Defaults module';
  $index_name = 'Default content index';
  $index_description = 'Default content index created by the Database Search Defaults module';

  // Check server exist.
  $this
    ->drupalGet('admin/config/search/search-api/server/default_server');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains($server_name);
  $this
    ->assertSession()
    ->pageTextContains($server_description);
  $this
    ->assertSession()
    ->pageTextContains($index_name);

  // Check index exist.
  $this
    ->drupalGet('admin/config/search/search-api');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains($index_name);
  $this
    ->assertSession()
    ->pageTextContains($index_description);
}