You are here

protected function PreviewTest::getPreviewAJAX in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views_ui/src/Tests/PreviewTest.php \Drupal\views_ui\Tests\PreviewTest::getPreviewAJAX()

Get the preview form and force an AJAX preview update.

Parameters

string $view_name: The view to test.

string $panel_id: The view panel to test.

int $row_count: The expected number of rows in the preview.

2 calls to PreviewTest::getPreviewAJAX()
PreviewTest::testPreviewWithPagersUI in core/modules/views_ui/src/Tests/PreviewTest.php
Tests pagers in the preview form.
PreviewTest::testTaxonomyAJAX in core/modules/views_ui/src/Tests/PreviewTest.php
Tests the taxonomy term preview AJAX.

File

core/modules/views_ui/src/Tests/PreviewTest.php, line 243
Contains \Drupal\views_ui\Tests\PreviewTest.

Class

PreviewTest
Tests the UI preview functionality.

Namespace

Drupal\views_ui\Tests

Code

protected function getPreviewAJAX($view_name, $panel_id, $row_count) {
  $this
    ->drupalGet('admin/structure/views/view/' . $view_name . '/preview/' . $panel_id);
  $result = $this
    ->drupalPostAjaxForm(NULL, array(), array(
    'op' => t('Update preview'),
  ));
  $this
    ->assertPreviewAJAX($result, $row_count);
}