diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/ExposedFormTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/ExposedFormTest.php index 1276bd9..e4755bc 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/ExposedFormTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/ExposedFormTest.php @@ -49,7 +49,7 @@ protected function setUp() { } /** - * Tests whether the reset button works on an expoed form. + * Tests whether the reset button works on an exposed form. */ public function testResetButton() { $this->drupalGet('test_reset_button', array('query' => array('type' => 'article'))); @@ -89,6 +89,22 @@ public function testRenameResetButton() { } /** + * Tests the exposed form markup. + */ + public function testExposedFormRender() { + $view = views_get_view('test_reset_button'); + $this->executeView($view); + $exposed_form = $view->display_handler->getPlugin('exposed_form'); + $this->drupalSetContent($exposed_form->render_exposed_form()); + + $expected_id = drupal_clean_css_identifier('views-exposed-form-' . $view->storage->id() . '-' . $view->current_display); + $this->assertFieldByXpath('//form/@id', $expected_id, 'Expected form ID found.'); + + $expected_action = url($view->display_handler->getUrl()); + $this->assertFieldByXPath('//form/@action', $expected_action, 'The expected value for the action attribute was found.'); + } + + /** * Tests the admin interface of exposed filter and sort items. */ function testExposedAdminUi() { diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 058de63..25fabc8 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -1566,11 +1566,6 @@ function views_exposed_form($form, &$form_state) { $form['#id'] = drupal_clean_css_identifier('views_exposed_form-' . check_plain($view->storage->get('name')) . '-' . check_plain($display['id'])); // $form['#attributes']['class'] = array('views-exposed-form'); - // If using AJAX, we need the form plugin. - if ($view->use_ajax) { - $form['#attached']['library'][] = array('system', 'jquery.form'); - } - $exposed_form_plugin = $form_state['exposed_form_plugin']; $exposed_form_plugin->exposed_form_alter($form, $form_state);