Tests whether the reset button works on an exposed form.
public function testResetButton() {
// Test the button is hidden when there is no exposed input.
$this
->drupalGet('test_reset_button');
$this
->assertNoField('edit-reset');
$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.');
// Test the button is hidden after reset.
$this
->assertNoField('edit-reset');
}