function VocabularyLanguageTest::setUp

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

Overrides TaxonomyTestBase::setUp

File

core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php, line 30

Class

VocabularyLanguageTest
Tests the language functionality for vocabularies.

Namespace

Drupal\Tests\taxonomy\Functional

Code

protected function setUp() : void {
  parent::setUp();
  // Create an administrative user.
  $this->drupalLogin($this->drupalCreateUser([
    'administer taxonomy',
  ]));
  // Add some custom languages.
  ConfigurableLanguage::create([
    'id' => 'aa',
    'label' => $this->randomMachineName(),
  ])
    ->save();
  ConfigurableLanguage::create([
    'id' => 'bb',
    'label' => $this->randomMachineName(),
  ])
    ->save();
}

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