diff --git a/core/modules/config/src/Tests/ConfigImporterTest.php b/core/modules/config/src/Tests/ConfigImporterTest.php index 581b5c4..a08d288 100644 --- a/core/modules/config/src/Tests/ConfigImporterTest.php +++ b/core/modules/config/src/Tests/ConfigImporterTest.php @@ -539,4 +539,24 @@ function testIsInstallable() { $this->assertTrue($this->container->get('config.storage')->exists($config_name)); } + /** + * Tests imported configuration entities with and without language information. + */ + function testLanguage() { + // Test imported configuration with implicit language code. + $data = $this->container->get('config.storage.installer')->read('config_test.dynamic.dotted.default'); + $this->assertTrue(!isset($data['langcode'])); + $this->assertEqual( + $this->config('config_test.dynamic.dotted.default')->get('langcode'), + 'en' + ); + + // Test imported configuration with explicit language code. + $data = $this->container->get('config.storage.installer')->read('config_test.dynamic.dotted.french'); + $this->assertEqual($data['langcode'], 'fr'); + $this->assertEqual( + $this->config('config_test.dynamic.dotted.french')->get('langcode'), + 'fr' + ); + } } diff --git a/core/modules/config/tests/config_test/config/install/config_test.dynamic.dotted.french.yml b/core/modules/config/tests/config_test/config/install/config_test.dynamic.dotted.french.yml new file mode 100644 index 0000000..15927d2 --- /dev/null +++ b/core/modules/config/tests/config_test/config/install/config_test.dynamic.dotted.french.yml @@ -0,0 +1,5 @@ +id: dotted.french +label: Default +weight: 0 +protected_property: Default +langcode: fr