Commit 68eecef4 authored by catch's avatar catch

Issue #1497132 by alexpott, pcambra, marcingy: follow-up for generalised...

Issue #1497132 by alexpott, pcambra, marcingy: follow-up for generalised function to update variables from Drupal 7 to Drupal 8's configuration management system.
parent f9d4759b
......@@ -851,23 +851,23 @@ function update_retrieve_dependencies() {
/**
* Updates config with values set on Drupal 7.x
*
*
* Provide a generalised method to migrate variables from Drupal 7 to Drupal 8's
* configuration management system.
*
* @param $config_name
* The name of the configuration object to retrieve. The name corresponds to
* an XML configuration file. For @code config(book.admin) @endcode, the
* config object returned will contain the contents of book.admin.xml.
* an XML configuration file. For example, passing "book.admin" will return
* the config object containing the contents of book.admin.xml.
* @param $variable_map
* An array to map new to old configuration naming conventions. Example:
* @code
* array('new_config' => 'old_config')
* @endcode
* This would update the value for new_config to the value old_config has in
* @endcode
* This would update the value for new_config to the value old_config has in
* the variable table.
*/
function update_variables_to_config($config_name, $variable_map = array()) {
function update_variables_to_config($config_name, array $variable_map = array()) {
$config = config($config_name);
$config_data = array_keys($config->get());
......
......@@ -306,7 +306,7 @@ class ConfUpdate7to8TestCase extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'Configuration update from Drupal 7 to 8',
'description' => 'Tests the ability to update Drupal 7 variables to the
'description' => 'Tests the ability to update Drupal 7 variables to the
configuration management system.',
'group' => 'Configuration',
);
......@@ -329,7 +329,7 @@ class ConfUpdate7to8TestCase extends DrupalWebTestCase {
update_variables_to_config('config.test', array('config_test_bar' => 'config_bar'));
$config = config('config.test');
$this->assertEqual($config->get('config_test_foo'), $this->testContent);
$this->assertEqual($config->get('config_test_bar'), $this->testContent);
$this->assertEqual($config->get('config_test_foo'), $this->testContent);
$this->assertEqual($config->get('config_test_bar'), $this->testContent);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment