function MenuUiLanguageTest::setUp

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

Overrides BrowserTestBase::setUp

File

core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php, line 38

Class

MenuUiLanguageTest
Tests for menu_ui language settings.

Namespace

Drupal\Tests\menu_ui\Functional

Code

protected function setUp() {
    parent::setUp();
    $this->drupalLogin($this->drupalCreateUser([
        'access administration pages',
        'administer menu',
    ]));
    // Add some custom languages.
    foreach ([
        'aa',
        'bb',
        'cc',
        'cs',
    ] as $language_code) {
        ConfigurableLanguage::create([
            'id' => $language_code,
            'label' => $this->randomMachineName(),
        ])
            ->save();
    }
}

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