You are here

public function LanguageIntegrationTest::testSearchApiPage in Search API Pages 8

Tests Search API Pages language integration.

File

tests/src/Functional/LanguageIntegrationTest.php, line 71

Class

LanguageIntegrationTest
Provides web tests for Search API Pages with language integration.

Namespace

Drupal\Tests\search_api_page\Functional

Code

public function testSearchApiPage() {
  $assert_session = $this
    ->assertSession();
  $this
    ->drupalGet('/search');
  $this
    ->drupalPostForm(NULL, [
    'keys' => 'bird',
  ], 'Search');
  $assert_session
    ->statusCodeEquals(200);
  $assert_session
    ->pageTextContains('1 result found');
  $assert_session
    ->pageTextContains('Hawk');
  $assert_session
    ->pageTextNotContains('Your search yielded no results.');
  $this
    ->drupalGet('/nl/search');
  $this
    ->drupalPostForm(NULL, [
    'keys' => 'bird',
  ], 'Search');
  $assert_session
    ->statusCodeEquals(200);
  $assert_session
    ->pageTextContains('1 result found');
  $assert_session
    ->pageTextContains('Havik');
  $assert_session
    ->pageTextNotContains('Your search yielded no results.');
}