public function ExposedFormTest::testResetButton

Tests whether the reset button works on an expoed form.

File

drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/ExposedFormTest.php, line 54
Definition of Drupal\views\Tests\Plugin\ExposedFormTest.

Class

ExposedFormTest
Tests exposed forms.

Namespace

Drupal\views\Tests\Plugin

Code

public function testResetButton() {
  $this
    ->drupalGet('test_reset_button', array(
    'query' => array(
      'type' => 'article',
    ),
  ));

  // Test that the type has been set.
  $this
    ->assertFieldById('edit-type', 'article', 'Article type filter set.');

  // Test the reset works.
  $this
    ->drupalGet('test_reset_button', array(
    'query' => array(
      'op' => 'Reset',
    ),
  ));
  $this
    ->assertResponse(200);

  // Test the type has been reset.
  $this
    ->assertFieldById('edit-type', 'All', 'Article type filter has been reset.');
}