diff --git a/core/modules/config/config.module b/core/modules/config/config.module index b3d9bbc..4242fc5 100644 --- a/core/modules/config/config.module +++ b/core/modules/config/config.module @@ -1 +1,6 @@ 'bar', 'biff' => array( 'bang' => 'pow', - ) + ), ); $casting_array_key = 'casting_array'; $casting_array_false_value_key = 'casting_array.cast.false'; $casting_array_value = array( 'cast' => array( 'false' => FALSE, - ) + ), ); $nested_array_key = 'nested.array'; $true_key = 'true'; @@ -134,7 +134,6 @@ class ConfigFileContentTestCase extends DrupalWebTestCase { $config = config($name); // Verify an configuration object is returned. -// $this->assertEqual($config->name, $name); $this->assertTrue($config, t('Config object created.')); // Verify the configuration object is empty. @@ -145,23 +144,23 @@ class ConfigFileContentTestCase extends DrupalWebTestCase { $this->assertIdentical($db_config, FALSE, t('Active store does not have a record for %name', array('%name' => $name))); $this->assertFalse(file_exists($config_dir . '/' . $name . '.' . $this->fileExtension), 'Configuration file does not exist.'); - // Add a top level value + // Add a top level value. $config = config($name); $config->set($key, $value); - // Add a nested value + // Add a nested value. $config->set($nested_key, $nested_value); - // Add an array + // Add an array. $config->set($array_key, $array_value); - // Add a nested array + // Add a nested array. $config->set($nested_array_key, $array_value); - // Add a boolean false value. Should get cast to 0 + // Add a boolean false value; should get cast to 0. $config->set($false_key, FALSE); - // Add a boolean true value. Should get cast to 1 + // Add a boolean true value; should get cast to 1. $config->set($true_key, TRUE); // Add an array with a nested boolean false that should get cast to 0. @@ -175,56 +174,55 @@ class ConfigFileContentTestCase extends DrupalWebTestCase { // Verify the file exists. $this->assertTrue(file_exists($config_dir . '/' . $name . '.' . $this->fileExtension), t('After saving configuration, config file exists.')); - // Read top level value + // Read top level value. $config = config($name); -// $this->assertEqual($config->name, $name); $this->assertTrue($config, 'Config object created.'); $this->assertEqual($config->get($key), 'bar', t('Top level configuration value found.')); - // Read nested value + // Read nested value. $this->assertEqual($config->get($nested_key), $nested_value, t('Nested configuration value found.')); - // Read array + // Read array. $this->assertEqual($config->get($array_key), $array_value, t('Top level array configuration value found.')); - // Read nested array + // Read nested array. $this->assertEqual($config->get($nested_array_key), $array_value, t('Nested array configuration value found.')); - // Read a top level value that doesn't exist + // Read a top level value that doesn't exist. $this->assertNull($config->get('i_dont_exist'), t('Non-existent top level value returned NULL.')); - // Read a nested value that doesn't exist + // Read a nested value that doesn't exist. $this->assertNull($config->get('i.dont.exist'), t('Non-existent nested value returned NULL.')); - // Read false value - $this->assertEqual($config->get($false_key), '0', t('Boolean FALSE value returned the string \'0\'.')); + // Read false value. + $this->assertEqual($config->get($false_key), '0', t("Boolean FALSE value returned the string '0'.")); - // Read true value - $this->assertEqual($config->get($true_key), '1', t('Boolean TRUE value returned the string \'1\'.')); + // Read true value. + $this->assertEqual($config->get($true_key), '1', t("Boolean TRUE value returned the string '1'.")); - // Read false that had been nested in an array value - $this->assertEqual($config->get($casting_array_false_value_key), '0', t('Nested boolean FALSE value returned the string \'0\'.')); + // Read false that had been nested in an array value. + $this->assertEqual($config->get($casting_array_false_value_key), '0', t("Nested boolean FALSE value returned the string '0'.")); - // Unset a top level value + // Unset a top level value. $config->clear($key); - // Unset a nested value + // Unset a nested value. $config->clear($nested_key); $config->save(); $config = config($name); - // Read unset top level value + // Read unset top level value. $this->assertNull($config->get($key), t('Top level value unset.')); - // Read unset nested value + // Read unset nested value. $this->assertNull($config->get($nested_key), t('Nested value unset.')); - // Create two new configuration files to test listing + // Create two new configuration files to test listing. $config = config('foo.baz'); $config->set($key, $value); $config->save(); - // Test chained set()->save() + // Test chained set()->save(). $chained_name = 'biff.bang'; $config = config($chained_name); $config->set($key, $value)->save(); @@ -306,8 +304,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 - configuration management system.', + 'description' => 'Tests the ability to update Drupal 7 variables to the configuration management system.', 'group' => 'Configuration', ); }