function LocaleThemeInstallTest::testThemeSetDefaultRewritesConfigLangcode

Same name and namespace in other branches
  1. main core/modules/locale/tests/src/Functional/LocaleThemeInstallTest.php \Drupal\Tests\locale\Functional\LocaleThemeInstallTest::testThemeSetDefaultRewritesConfigLangcode()

Tests that "install as default" also updates config language.

File

core/modules/locale/tests/src/Functional/LocaleThemeInstallTest.php, line 92

Class

LocaleThemeInstallTest
Tests that locale rewrites config langcodes after theme install.

Namespace

Drupal\Tests\locale\Functional

Code

public function testThemeSetDefaultRewritesConfigLangcode() : void {
  $this->drupalGet('admin/appearance');
  $this->cssSelect('a[title="Install Olivero as default theme"]')[0]
    ->click();
  $this->checkForMetaRefresh();
  $this->rebuildContainer();
  $langcode = $this->config('core.date_format.olivero_medium')
    ->get('langcode');
  $this->assertSame('de', $langcode);
  $this->assertSession()
    ->addressEquals('admin/appearance');
  $this->assertSession()
    ->pageTextContains('Olivero is now the default theme.');
}

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