function ContainerResetWebTest::setUp

Same name in other branches
  1. 11.x core/modules/system/tests/src/Functional/DrupalKernel/ContainerResetWebTest.php \Drupal\Tests\system\Functional\DrupalKernel\ContainerResetWebTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/system/tests/src/Functional/DrupalKernel/ContainerResetWebTest.php, line 29

Class

ContainerResetWebTest
Ensures that the container rebuild works as expected.

Namespace

Drupal\Tests\system\Functional\DrupalKernel

Code

protected function setUp() : void {
    parent::setUp();
    ConfigurableLanguage::createFromLangcode('es')->save();
    // Create translations for testing.
    $locale_storage = $this->container
        ->get('locale.storage');
    $langcode = 'es';
    $source = $locale_storage->createString([
        'source' => 'Before the container was reset.',
    ])
        ->save();
    $locale_storage->createTranslation([
        'lid' => $source->lid,
        'language' => $langcode,
        'translation' => 'Antes de que el contenedor fuera reiniciado.',
    ])
        ->save();
    $source = $locale_storage->createString([
        'source' => 'After the container was reset.',
    ])
        ->save();
    $locale_storage->createTranslation([
        'lid' => $source->lid,
        'language' => $langcode,
        'translation' => 'Después de que el contenedor fue reiniciado.',
    ])
        ->save();
}

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