You are here

public function ViewsExposedGroupsInheritedPropertiesTest::testView in Views exposed groups 7.2

Asserts that the view itself is displayed correctly.

It is not possible to test the actual functionality of the reset and autosubmit functionality.

File

tests/views_exposed_groups_inherit.test, line 91
ViewsExposedGroupsInheritedPropertiesTest.

Class

ViewsExposedGroupsInheritedPropertiesTest
Tests a view with exposed groups and autosubmit.

Code

public function testView() {
  $view_path = $this->defaultView
    ->get_path();

  // Bypass the UI for this test.
  $this->defaultView
    ->set_display('default');
  $this->defaultView->display['default']->display_options['exposed_form']['options']['autosubmit'] = TRUE;
  $this->defaultView->disabled['default']->display_options['exposed_form']['options']['autosubmit_hide'] = TRUE;
  $this->defaultView->display['default']->display_options['exposed_form']['options']['reset_button'] = TRUE;
  views_save_view($this->defaultView);
  $this
    ->drupalLogin($this->unprivilegedUser);
  $this
    ->drupalGet($view_path);

  // An apply button exists when Javascript is disabled so assert that this
  // exists for autosubmit.
  $this
    ->assertFieldByXpath('//input[@value="Apply" and @type="submit" and contains(@class, "js-hide")]');

  // Asserts that the reset button exists.
  $this
    ->assertFieldByXpath('//input[@value="Reset" and @type="submit"]');
}