You are here

protected function IntegrationTest::checkUndefinedLanguageItemsAreFound in Search API Pages 8

Regression test for #3053095.

1 call to IntegrationTest::checkUndefinedLanguageItemsAreFound()
IntegrationTest::testFramework in tests/src/Functional/IntegrationTest.php
Sets up an environment for testing + delegates to other methods for tests.

File

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

Class

IntegrationTest
Provides web tests for Search API Pages.

Namespace

Drupal\Tests\search_api_page\Functional

Code

protected function checkUndefinedLanguageItemsAreFound() {
  $this
    ->drupalCreateNode([
    'title' => 'Another article',
    'type' => 'article',
    'body' => [
      [
        'value' => 'Undefined language',
      ],
    ],
    'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
  ]);
  $this
    ->indexItems($this->index
    ->id());
  $assert_session = $this
    ->assertSession();
  $this
    ->drupalGet('/search');
  $assert_session
    ->statusCodeEquals(200);
  $this
    ->drupalPostForm(NULL, [
    'keys' => 'Undefined',
  ], 'Search');
  $assert_session
    ->statusCodeEquals(200);
  $assert_session
    ->pageTextContains('1 result found');
}