You are here

protected function BlockLanguageCacheTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 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;
  }
}