diff --git a/core/modules/views_ui/src/Tests/DisplayTest.php b/core/modules/views_ui/src/Tests/DisplayTest.php index 53e3556..4fab7d8 100644 --- a/core/modules/views_ui/src/Tests/DisplayTest.php +++ b/core/modules/views_ui/src/Tests/DisplayTest.php @@ -38,9 +38,7 @@ class DisplayTest extends UITestBase { * Tests adding a display. */ public function testAddDisplay() { - $view = array( - ); - $view = $this->randomView($view); + $view = $this->randomView(); $this->assertNoText('Block'); $this->assertNoText('Block 2'); @@ -48,29 +46,15 @@ public function testAddDisplay() { $this->assertText('Block'); $this->assertNoText('Block 2'); - $this->drupalPostForm(NULL, [], 'Block'); + // Views has special form handling in views_ui_form_button_was_clicked() + // to be able to change the submit button text via JS, this simulates what + // the JS is doing. + $this->drupalPostForm(NULL, [], NULL, [], [], NULL, '&op=Block'); $this->assertText('Block'); $this->assertText('Block 2'); } /** - * {@inheritdoc} - */ - protected function handleForm(&$post, &$edit, &$upload, $submit, $form) { - $result = parent::handleForm($post, $edit, $upload, $submit, $form); - // We override the method to be able to post 'Block' as button. Views has - // its own special form handling in views_ui_form_button_was_clicked() to be - // able to change the submit button text via JS. - // By passing 'Block' as the button we are able to simulate what the JS is - // doing. - if ($submit === 'Block') { - $post['op'] = 'Block'; - $result = TRUE; - } - return $result; - } - - /** * Tests reordering of displays. */ public function testReorderDisplay() {