You are here

protected function UserKernelTestBase::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/user/tests/src/Kernel/Views/UserKernelTestBase.php \Drupal\Tests\user\Kernel\Views\UserKernelTestBase::setUp()
  2. 9 core/modules/user/tests/src/Kernel/Views/UserKernelTestBase.php \Drupal\Tests\user\Kernel\Views\UserKernelTestBase::setUp()

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.

Overrides ViewsKernelTestBase::setUp

1 call to UserKernelTestBase::setUp()
HandlerFilterCurrentUserTest::setUp in core/modules/user/tests/src/Kernel/Views/HandlerFilterCurrentUserTest.php
1 method overrides UserKernelTestBase::setUp()
HandlerFilterCurrentUserTest::setUp in core/modules/user/tests/src/Kernel/Views/HandlerFilterCurrentUserTest.php

File

core/modules/user/tests/src/Kernel/Views/UserKernelTestBase.php, line 41

Class

UserKernelTestBase
Provides a common test base for user views tests.

Namespace

Drupal\Tests\user\Kernel\Views

Code

protected function setUp($import_test_views = TRUE) : void {
  parent::setUp();
  ViewTestData::createTestViews(static::class, [
    'user_test_views',
  ]);
  $this
    ->installEntitySchema('user');
  $entity_type_manager = $this->container
    ->get('entity_type.manager');
  $this->roleStorage = $entity_type_manager
    ->getStorage('user_role');
  $this->userStorage = $entity_type_manager
    ->getStorage('user');
}