diff -u b/core/includes/config.inc b/core/includes/config.inc --- b/core/includes/config.inc +++ b/core/includes/config.inc @@ -88,7 +88,17 @@ } /** - * Parse a config file directly from module config directory. + * Parse a config file directly from a module's config directory. + * + * @param $name + * The name of the configuration object to retrieve. The name corresponds to + * a configuration file. For @code config(book.admin) @endcode, the config + * object returned will contain the contents of book.admin configuration file. + * @param $module + * The name of a module that provides the configuration file. + * + * @return + * An array containing the configuration data. */ function config_load_and_parse_module_config($config_name, $module) { $file_storage = new FileStorage($config_name); only in patch2: unchanged: --- a/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php @@ -246,4 +246,20 @@ class ConfigFileContentTest extends WebTestBase { $key = 'invalid xml'; $this->assertIdentical($config_data[$key], $config_parsed[$key]); } + + /** + * Test loading and parsing a config file from a module's config directory. + */ + function testLoadAndParseModuleConfig() { + $expected = array( + 'parent' => + array( + 'bar' => 'Bar', + 'baz' => 'Baz', + ), + 'foo' => 'Foo', + ); + $module_config = config_load_and_parse_module_config('config_upgrade.test', 'config_upgrade'); + $this->assertIdentical($module_config, $expected); + } }