You are here

public function SearchConfigSettingsFormTest::testSearchModuleSettingsPage 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::testSearchModuleSettingsPage()

Verifies plugin-supplied settings form.

File

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

Class

SearchConfigSettingsFormTest
Verify the search config settings form.

Namespace

Drupal\Tests\search\Functional

Code

public function testSearchModuleSettingsPage() {
  $this
    ->drupalGet('admin/config/search/pages');
  $this
    ->clickLink('Edit', 1);

  // Ensure that the default setting was picked up from the default config
  $this
    ->assertTrue($this
    ->assertSession()
    ->optionExists('edit-extra-type-settings-boost', 'bi')
    ->isSelected());

  // Change extra type setting and also modify a common search setting.
  $edit = [
    'extra_type_settings[boost]' => 'ii',
  ];
  $this
    ->submitForm($edit, 'Save search page');

  // Ensure that the modifications took effect.
  $this
    ->assertSession()
    ->pageTextContains("The Dummy search type search page has been updated.");
  $this
    ->drupalGet('admin/config/search/pages/manage/dummy_search_type');
  $this
    ->assertTrue($this
    ->assertSession()
    ->optionExists('edit-extra-type-settings-boost', 'ii')
    ->isSelected());
}