You are here

protected function ViewTestBase::executeView in Drupal 10

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

Executes a view.

Parameters

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

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

22 calls to ViewTestBase::executeView()
DefaultViewRecentCommentsTest::testBlockDisplay in core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php
Tests the block defined by the comments_recent view.
FieldTypeTest::testFieldType in core/modules/block_content/tests/src/Functional/Views/FieldTypeTest.php
ForumIntegrationTest::testForumIntegration in core/modules/forum/tests/src/Functional/Views/ForumIntegrationTest.php
Tests the integration.
FrontPageTest::testFrontPage in core/modules/node/tests/src/Functional/Views/FrontPageTest.php
Tests the frontpage.
HandlerFieldUserNameTest::testNoAdditionalFields in core/modules/user/tests/src/Functional/Views/HandlerFieldUserNameTest.php
Tests that the field handler works when no additional fields are added.

... See full list

File

core/modules/views/tests/src/Functional/ViewTestBase.php, line 120

Class

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

Namespace

Drupal\Tests\views\Functional

Code

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

  // 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();
}