function BlockContentTestBase::setUp

Same name in this branch
  1. 8.9.x core/modules/block_content/src/Tests/BlockContentTestBase.php \Drupal\block_content\Tests\BlockContentTestBase::setUp()
  2. 8.9.x core/modules/block_content/tests/src/Functional/Views/BlockContentTestBase.php \Drupal\Tests\block_content\Functional\Views\BlockContentTestBase::setUp()
  3. 8.9.x core/modules/block_content/tests/src/Functional/BlockContentTestBase.php \Drupal\Tests\block_content\Functional\BlockContentTestBase::setUp()
Same name in other branches
  1. 9 core/modules/block_content/tests/src/Functional/Views/BlockContentTestBase.php \Drupal\Tests\block_content\Functional\Views\BlockContentTestBase::setUp()
  2. 9 core/modules/block_content/tests/src/Functional/BlockContentTestBase.php \Drupal\Tests\block_content\Functional\BlockContentTestBase::setUp()
  3. 10 core/modules/block_content/tests/src/Functional/Views/BlockContentTestBase.php \Drupal\Tests\block_content\Functional\Views\BlockContentTestBase::setUp()
  4. 10 core/modules/block_content/tests/src/Functional/BlockContentTestBase.php \Drupal\Tests\block_content\Functional\BlockContentTestBase::setUp()
  5. 11.x core/modules/block_content/tests/src/Functional/Views/BlockContentTestBase.php \Drupal\Tests\block_content\Functional\Views\BlockContentTestBase::setUp()
  6. 11.x core/modules/block_content/tests/src/Functional/BlockContentTestBase.php \Drupal\Tests\block_content\Functional\BlockContentTestBase::setUp()

Overrides ViewTestBase::setUp

File

core/modules/block_content/src/Tests/Views/BlockContentTestBase.php, line 48

Class

BlockContentTestBase
Base class for all block_content tests.

Namespace

Drupal\block_content\Tests\Views

Code

protected function setUp($import_test_views = TRUE) {
    parent::setUp($import_test_views);
    // Ensure the basic bundle exists. This is provided by the standard profile.
    $this->createBlockContentType([
        'id' => 'basic',
    ]);
    $this->adminUser = $this->drupalCreateUser($this->permissions);
    if ($import_test_views) {
        ViewTestData::createTestViews(get_class($this), [
            'block_content_test_views',
        ]);
    }
}

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