function SearchPageOverrideTest::testSearchPageHook

Same name in other branches
  1. 9 core/modules/search/tests/src/Functional/SearchPageOverrideTest.php \Drupal\Tests\search\Functional\SearchPageOverrideTest::testSearchPageHook()
  2. 8.9.x core/modules/search/tests/src/Functional/SearchPageOverrideTest.php \Drupal\Tests\search\Functional\SearchPageOverrideTest::testSearchPageHook()
  3. 11.x core/modules/search/tests/src/Functional/SearchPageOverrideTest.php \Drupal\Tests\search\Functional\SearchPageOverrideTest::testSearchPageHook()

File

core/modules/search/tests/src/Functional/SearchPageOverrideTest.php, line 50

Class

SearchPageOverrideTest
Tests if the result page can be overridden.

Namespace

Drupal\Tests\search\Functional

Code

public function testSearchPageHook() : void {
    $keys = 'bike shed ' . $this->randomMachineName();
    $this->drupalGet("search/dummy_path", [
        'query' => [
            'keys' => $keys,
        ],
    ]);
    $this->assertSession()
        ->pageTextContains('Dummy search snippet');
    $this->assertSession()
        ->pageTextContains('Test page text is here');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.