You are here

protected function ViewsKernelTestBase::executeView in Drupal 8

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

170 calls to ViewsKernelTestBase::executeView()
AreaDisplayLinkTest::assertRenderedDisplayLinks in core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php
Assert the display links are correctly rendered for a display.
AreaDisplayLinkTest::testAreaDisplayLink in core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php
Tests the views area display_link handler.
AreaEmptyTest::testRenderEmptyHeaderFooter in core/modules/views/tests/src/Kernel/Handler/AreaEmptyTest.php
Tests that the header and footer areas are not rendered if empty.
AreaMessagesTest::testMessageText in core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php
Tests the messages area handler.
AreaResultTest::testResult in core/modules/views/tests/src/Kernel/Handler/AreaResultTest.php
Tests the results area handler.

... See full list

File

core/modules/views/tests/src/Kernel/ViewsKernelTestBase.php, line 128

Class

ViewsKernelTestBase
Defines a base class for Views kernel testing.

Namespace

Drupal\Tests\views\Kernel

Code

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