function BlockLanguageCacheTest::setUp

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

Overrides BrowserTestBase::setUp

File

core/modules/block/tests/src/Functional/BlockLanguageCacheTest.php, line 34

Class

BlockLanguageCacheTest
Tests display of menu blocks with multiple languages.

Namespace

Drupal\Tests\block\Functional

Code

protected function setUp() {
    parent::setUp();
    // Create test languages.
    $this->langcodes = [
        ConfigurableLanguage::load('en'),
    ];
    for ($i = 1; $i < 3; ++$i) {
        $language = ConfigurableLanguage::create([
            'id' => 'l' . $i,
            'label' => $this->randomString(),
        ]);
        $language->save();
        $this->langcodes[$i] = $language;
    }
}

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