You are here

protected function TermLanguageTest::setUp in Drupal 9

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

Overrides TaxonomyTestBase::setUp

File

core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php, line 29

Class

TermLanguageTest
Tests the language functionality for the taxonomy terms.

Namespace

Drupal\Tests\taxonomy\Functional

Code

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

  // Create an administrative user.
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'administer taxonomy',
  ]));

  // Create a vocabulary to which the terms will be assigned.
  $this->vocabulary = $this
    ->createVocabulary();

  // Add some custom languages.
  foreach ([
    'aa',
    'bb',
    'cc',
  ] as $language_code) {
    ConfigurableLanguage::create([
      'id' => $language_code,
      'label' => $this
        ->randomMachineName(),
    ])
      ->save();
  }
}