You are here

protected function TermParentsTest::setUp in Drupal 10

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

File

core/modules/taxonomy/tests/src/Functional/TermParentsTest.php, line 50

Class

TermParentsTest
Tests managing taxonomy parents through the user interface.

Namespace

Drupal\Tests\taxonomy\Functional

Code

protected function setUp() : void {
  parent::setUp();

  /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */
  $entity_type_manager = $this->container
    ->get('entity_type.manager');
  $this->termStorage = $entity_type_manager
    ->getStorage('taxonomy_term');
  $this->state = $this->container
    ->get('state');
  Vocabulary::create([
    'vid' => $this->vocabularyId,
  ])
    ->save();
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'administer taxonomy',
  ]));
}