You are here

public function PreviewTest::testPreviewError in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views_ui/tests/src/Functional/PreviewTest.php \Drupal\Tests\views_ui\Functional\PreviewTest::testPreviewError()
  2. 10 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 157

Class

PreviewTest
Tests the UI preview functionality.

Namespace

Drupal\Tests\views_ui\Functional

Code

public function testPreviewError() {
  $this
    ->drupalGet('admin/structure/views/view/test_preview_error/edit');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalPostForm(NULL, $edit = [], t('Update preview'));
  $this
    ->assertText('Unable to preview due to validation errors.', 'Preview error text found.');
}