You are here

protected function FeedLanguageTest::setUp in Drupal 9

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

Overrides AggregatorTestBase::setUp

File

core/modules/aggregator/tests/src/Functional/FeedLanguageTest.php, line 39

Class

FeedLanguageTest
Tests aggregator feeds in multiple languages.

Namespace

Drupal\Tests\aggregator\Functional

Code

protected function setUp() : void {
  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
      ->id();
  }
}