function PreviewTest::testPreviewError

Same name in other branches
  1. 9 core/modules/views_ui/tests/src/Functional/PreviewTest.php \Drupal\Tests\views_ui\Functional\PreviewTest::testPreviewError()
  2. 8.9.x core/modules/views_ui/tests/src/Functional/PreviewTest.php \Drupal\Tests\views_ui\Functional\PreviewTest::testPreviewError()
  3. 11.x core/modules/views_ui/tests/src/Functional/PreviewTest.php \Drupal\Tests\views_ui\Functional\PreviewTest::testPreviewError()

Tests view validation error messages in the preview.

File

core/modules/views_ui/tests/src/Functional/PreviewTest.php, line 174

Class

PreviewTest
Tests the UI preview functionality.

Namespace

Drupal\Tests\views_ui\Functional

Code

public function testPreviewError() : void {
    $this->drupalGet('admin/structure/views/view/test_preview_error/edit');
    $this->assertSession()
        ->statusCodeEquals(200);
    $this->submitForm($edit = [], 'Update preview');
    $this->assertSession()
        ->pageTextContains('Unable to preview due to validation errors.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.