You are here

function ViewExecutableTest::testValidate in Views (for Drupal 7) 8.3

File

lib/Drupal/views/Tests/ViewExecutableTest.php, line 215
Definition of Drupal\views\Tests\ViewExecutableTest.

Class

ViewExecutableTest
Tests the ViewExecutable class.

Namespace

Drupal\views\Tests

Code

function testValidate() {

  // Test a view with multiple displays.
  // Validating a view shouldn't change the active display.
  // @todo Create an extra validation view.
  $this->view
    ->setDisplay('page_1');
  $this->view
    ->validate();
  $this
    ->assertEqual('page_1', $this->view->current_display, "The display should be constant while validating");

  // @todo Write real tests for the validation.
  // In general the following things could be tested:
  //   - Deleted displays shouldn't be validated
  //   - Multiple displays are validating and the errors are merged together.
}