You are here

function SearchConfigSettingsFormTest::testSearchModuleSettingsPage in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/search/src/Tests/SearchConfigSettingsFormTest.php \Drupal\search\Tests\SearchConfigSettingsFormTest::testSearchModuleSettingsPage()

Verifies plugin-supplied settings form.

File

core/modules/search/src/Tests/SearchConfigSettingsFormTest.php, line 112
Contains \Drupal\search\Tests\SearchConfigSettingsFormTest.

Class

SearchConfigSettingsFormTest
Verify the search config settings form.

Namespace

Drupal\search\Tests

Code

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

  // Ensure that the default setting was picked up from the default config
  $this
    ->assertTrue($this
    ->xpath('//select[@id="edit-extra-type-settings-boost"]//option[@value="bi" and @selected="selected"]'), 'Module specific settings are picked up from the default config');

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

  // Ensure that the modifications took effect.
  $this
    ->assertRaw(t('The %label search page has been updated.', array(
    '%label' => 'Dummy search type',
  )));
  $this
    ->drupalGet('admin/config/search/pages/manage/dummy_search_type');
  $this
    ->assertTrue($this
    ->xpath('//select[@id="edit-extra-type-settings-boost"]//option[@value="ii" and @selected="selected"]'), 'Module specific settings can be changed');
}