You are here

public function ViewsExposedGroupsInheritedPropertiesTest::testViewsUi in Views exposed groups 7.2

Asserts form sets values for inherited properties.

File

tests/views_exposed_groups_inherit.test, line 63
ViewsExposedGroupsInheritedPropertiesTest.

Class

ViewsExposedGroupsInheritedPropertiesTest
Tests a view with exposed groups and autosubmit.

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
    ->drupalPost(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');
}