diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/PreviewTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/PreviewTest.php index f1c8b9b..7f13413 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/PreviewTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/PreviewTest.php @@ -212,12 +212,18 @@ protected function getPreviewAJAX($view_name, $panel_id, $row_count) { * The expected number of rows in the preview. */ protected function clickPreviewLinkAJAX($url, $row_count) { + $content = $this->content; + $drupal_settings = $this->drupalSettings; $ajax_settings = array( - 'url' => $url, 'wrapper' => 'views-preview-wrapper', 'method' => 'replaceWith', ); - $result = $this->drupalPostAjaxForm(NULL, array(), NULL, NULL, array(), array(), NULL, $ajax_settings); + $url = $this->getAbsoluteUrl($url); + $post = array('js' => 'true') + $this->getAjaxPageStatePostData(); + $result = drupal_json_decode($this->drupalPost($url, 'application/vnd.drupal-ajax', $post)); + if (!empty($result)) { + $this->drupalProcessAjaxResponse($content, $result, $ajax_settings, $drupal_settings); + } $this->assertPreviewAJAX($result, $row_count); }