You are here

protected function ViewTestBase::executeView in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views/src/Tests/ViewTestBase.php \Drupal\views\Tests\ViewTestBase::executeView()

Executes a view with debugging.

Parameters

\Drupal\views\ViewExecutable $view: The view object.

array $args: (optional) An array of the view arguments to use for the view.

71 calls to ViewTestBase::executeView()
ArgumentDateTimeTest::testDatetimeArgumentAll in core/modules/datetime/src/Tests/Views/ArgumentDateTimeTest.php
Test year, month, and day arguments combined.
ArgumentDateTimeTest::testDatetimeArgumentDay in core/modules/datetime/src/Tests/Views/ArgumentDateTimeTest.php
Test day argument.
ArgumentDateTimeTest::testDatetimeArgumentMonth in core/modules/datetime/src/Tests/Views/ArgumentDateTimeTest.php
Test month argument.
ArgumentDateTimeTest::testDatetimeArgumentYear in core/modules/datetime/src/Tests/Views/ArgumentDateTimeTest.php
Test year argument.
ArgumentDefaultTest::testArgumentDefaultPlugin in core/modules/views/src/Tests/Plugin/ArgumentDefaultTest.php
Tests the argument default test plugin.

... See full list

File

core/modules/views/src/Tests/ViewTestBase.php, line 120
Contains \Drupal\views\Tests\ViewTestBase.

Class

ViewTestBase
Defines a base class for Views testing in the full web test environment.

Namespace

Drupal\views\Tests

Code

protected function executeView(ViewExecutable $view, $args = array()) {

  // A view does not really work outside of a request scope, due to many
  // dependencies like the current user.
  $view
    ->setDisplay();
  $view
    ->preExecute($args);
  $view
    ->execute();
  $verbose_message = '<pre>Executed view: ' . (string) $view->build_info['query'] . '</pre>';
  if ($view->build_info['query'] instanceof SelectInterface) {
    $verbose_message .= '<pre>Arguments: ' . print_r($view->build_info['query']
      ->getArguments(), TRUE) . '</pre>';
  }
  $this
    ->verbose($verbose_message);
}