You are here

protected function ViewKernelTestBase::executeView in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/ViewKernelTestBase.php \Drupal\views\Tests\ViewKernelTestBase::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.

104 calls to ViewKernelTestBase::executeView()
AreaTextTest::testAreaText in core/modules/views/src/Tests/Handler/AreaTextTest.php
AreaTitleTest::testTitleText in core/modules/views/src/Tests/Handler/AreaTitleTest.php
Tests the title area handler.
AreaViewTest::testViewArea in core/modules/views/src/Tests/Handler/AreaViewTest.php
Tests the view area handler.
ArgumentDateTest::testCreatedFullDateHandler in core/modules/views/src/Tests/Handler/ArgumentDateTest.php
Tests the CreatedFullDate handler.
ArgumentDateTest::testDayHandler in core/modules/views/src/Tests/Handler/ArgumentDateTest.php
Tests the Day handler.

... See full list

File

core/modules/views/src/Tests/ViewKernelTestBase.php, line 119
Contains \Drupal\views\Tests\ViewKernelTestBase.

Class

ViewKernelTestBase
Defines a base class for Views unit testing.

Namespace

Drupal\views\Tests

Code

protected function executeView($view, array $args = array()) {
  $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);
}