You are here

public function SearchConfigSettingsFormTest::testDefaultSearchPageOrdering in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php \Drupal\Tests\search\Functional\SearchConfigSettingsFormTest::testDefaultSearchPageOrdering()

Tests the ordering of search pages on a clean install.

File

core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php, line 249

Class

SearchConfigSettingsFormTest
Verify the search config settings form.

Namespace

Drupal\Tests\search\Functional

Code

public function testDefaultSearchPageOrdering() {
  $this
    ->drupalGet('search');
  $elements = $this
    ->xpath('//*[contains(@class, :class)]//a', [
    ':class' => 'tabs primary',
  ]);
  $this
    ->assertSame(Url::fromRoute('search.view_node_search')
    ->toString(), $elements[0]
    ->getAttribute('href'));
  $this
    ->assertSame(Url::fromRoute('search.view_dummy_search_type')
    ->toString(), $elements[1]
    ->getAttribute('href'));
  $this
    ->assertSame(Url::fromRoute('search.view_user_search')
    ->toString(), $elements[2]
    ->getAttribute('href'));
}