function ViewTestBase::setUp

Same name in other branches
  1. 9 core/modules/views/tests/src/Functional/ViewTestBase.php \Drupal\Tests\views\Functional\ViewTestBase::setUp()
  2. 8.9.x core/modules/views/src/Tests/ViewTestBase.php \Drupal\views\Tests\ViewTestBase::setUp()
  3. 8.9.x core/modules/views/tests/src/Functional/ViewTestBase.php \Drupal\Tests\views\Functional\ViewTestBase::setUp()
  4. 10 core/modules/views/tests/src/Functional/ViewTestBase.php \Drupal\Tests\views\Functional\ViewTestBase::setUp()

Sets up the test.

Parameters

bool $import_test_views: Should the views specified on the test class be imported. If you need to setup some additional stuff, like fields, you need to call false and then call createTestViews for your own.

array $modules: The module directories to look in for test views.

Overrides BrowserTestBase::setUp

76 calls to ViewTestBase::setUp()
AccessTest::setUp in core/modules/views/tests/src/Functional/Plugin/AccessTest.php
AreaTest::setUp in core/modules/views/tests/src/Functional/Handler/AreaTest.php
AreaTitleWebTest::setUp in core/modules/views/tests/src/Functional/Handler/AreaTitleWebTest.php
ArgumentDefaultTest::setUp in core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php
BaseFieldAccessTest::setUp in core/modules/views/tests/src/Functional/Entity/BaseFieldAccessTest.php

... See full list

76 methods override ViewTestBase::setUp()
AccessTest::setUp in core/modules/views/tests/src/Functional/Plugin/AccessTest.php
AreaTest::setUp in core/modules/views/tests/src/Functional/Handler/AreaTest.php
AreaTitleWebTest::setUp in core/modules/views/tests/src/Functional/Handler/AreaTitleWebTest.php
ArgumentDefaultTest::setUp in core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php
BaseFieldAccessTest::setUp in core/modules/views/tests/src/Functional/Entity/BaseFieldAccessTest.php

... See full list

File

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

Class

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

Namespace

Drupal\Tests\views\Functional

Code

protected function setUp($import_test_views = TRUE, $modules = [
    'views_test_config',
]) : void {
    parent::setUp();
    if ($import_test_views) {
        ViewTestData::createTestViews(static::class, $modules);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.