You are here

protected function DisableLanguageManagerTest::setUp in Disable language 8

Overrides KernelTestBase::setUp

File

tests/src/Kernel/DisableLanguageManagerTest.php, line 31

Class

DisableLanguageManagerTest
@coversDefaultClass \Drupal\disable_language\DisableLanguageManager @group disable_language

Namespace

Drupal\Tests\disable_language\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this->disableLanguageManager = \Drupal::service('disable_language.disable_language_manager');
  $this
    ->installConfig([
    'language',
  ]);
  $this
    ->installConfig([
    'disable_language',
  ]);
  ConfigurableLanguage::load('en')
    ->setWeight(0)
    ->save();
  ConfigurableLanguage::createFromLangcode('nl')
    ->setWeight(1)
    ->save();
  ConfigurableLanguage::createFromLangcode('fr')
    ->setWeight(2)
    ->setThirdPartySetting('disable_language', 'disable', 1)
    ->setThirdPartySetting('disable_language', 'redirect_language', 'nl')
    ->save();
}