function TermParentsTest::setUp

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

Overrides BrowserTestBase::setUp

File

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

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,
        'name' => 'Test',
    ])
        ->save();
    $this->drupalLogin($this->drupalCreateUser([
        'administer taxonomy',
    ]));
}

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