You are here

protected function UserFieldsTest::setUp in Drupal 9

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

Overrides KernelTestBase::setUp

File

core/modules/user/tests/src/Kernel/UserFieldsTest.php, line 25

Class

UserFieldsTest
Tests available user fields in twig.

Namespace

Drupal\Tests\user\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installEntitySchema('user');

  // Set up a test theme that prints the user's mail field.
  \Drupal::service('theme_installer')
    ->install([
    'user_test_theme',
  ]);
  \Drupal::theme()
    ->setActiveTheme(\Drupal::service('theme.initialization')
    ->initTheme('user_test_theme'));

  // Clear the theme registry.
  $this->container
    ->set('theme.registry', NULL);
}