function LanguageConfigInstallOverrideExistingTest::testLanguageConfigInstallOverrideExisting

Same name in other branches
  1. 10 core/modules/language/tests/src/Functional/LanguageConfigInstallOverrideExistingTest.php \Drupal\Tests\language\Functional\LanguageConfigInstallOverrideExistingTest::testLanguageConfigInstallOverrideExisting()

Tests when language config is installed existing config is not overridden.

File

core/modules/language/tests/src/Functional/LanguageConfigInstallOverrideExistingTest.php, line 29

Class

LanguageConfigInstallOverrideExistingTest
Ensures the language config is installed but not altered on install.

Namespace

Drupal\Tests\language\Functional

Code

public function testLanguageConfigInstallOverrideExisting() : void {
    
    /** @var \Drupal\Core\Config\StorageInterface $storage */
    $storage = $this->container
        ->get('config.storage');
    $config = $this->config('language.types');
    // The negotiation methods that have been removed should be disabled after
    // purging if not avoided in language_modules_installed().
    $language_types_data = $storage->read('language.types');
    $this->assertTrue(isset($language_types_data['negotiation']['language_content']['enabled']['test_language_negotiation_method']));
    $this->assertTrue(isset($language_types_data['negotiation']['language_content']['enabled']['language-selected']));
    $this->assertEquals(-10, $config->get('negotiation.language_content.enabled.test_language_negotiation_method'));
    $this->assertEquals(12, $config->get('negotiation.language_content.enabled.language-selected'));
}

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