You are here

public function ViewsExposedGroupsInheritedPropertiesTest::testViewsUi in Views exposed groups 3.0.x

Asserts form sets values for inherited properties.

File

tests/src/Functional/ViewsExposedGroupsInheritedPropertiesTest.php, line 50

Class

ViewsExposedGroupsInheritedPropertiesTest
Tests a view with exposed groups and autosubmit.

Namespace

Drupal\Tests\views_exposed_groups\Functional

Code

public function testViewsUi() {
  $views_ui_path = '/admin/structure/views/view/' . $this->defaultView->name;
  $this
    ->drupalLogin($this->privilegedUser);
  $this
    ->drupalGet($views_ui_path . '/edit');
  $this
    ->clickExposedFormOptionsLink('Grouped form');
  $edit = [
    'exposed_form_options[reset_button]' => '1',
    'exposed_form_options[autosubmit]' => '1',
    'exposed_form_options[autosubmit_hide]' => '1',
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Apply');

  // Asserts the form options are set.
  $exposed_options_path = 'admin/structure/views/nojs/display/' . $this->defaultView->name . '/default/exposed_form_options';
  $this
    ->drupalGet($exposed_options_path);
  $this
    ->assertFieldByName('exposed_form_options[reset_button]', '1');
  $this
    ->assertFieldByName('exposed_form_options[autosubmit]', '1');
  $this
    ->assertFieldByName('exposed_form_options[autosubmit_hide]', '1');
}