diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php index df3d103..7116bea 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php @@ -111,7 +111,7 @@ function testInstallProfileConfigOverwrite() { ), ); // The expected active configuration altered by the install profile. - $expected_overriden_data = array( + $expected_profile_data = array( 'threshold' => array( 'autorun' => 0, 'requirements_warning' => 259200, @@ -119,40 +119,34 @@ function testInstallProfileConfigOverwrite() { ), ); - // Enter an override-free context to ensure the original data remains. - $old_state = \Drupal::configFactory()->getOverrideState(); - \Drupal::configFactory()->setOverrideState(FALSE); - // Verify that the original data matches. We have to read the module config - // file directly, otherwise install profile overrides will apply. + // file directly, because the install profile default system.cron.yml + // configuration file was used to create the active configuration. $config_dir = drupal_get_path('module', 'system') . '/config'; $this->assertTrue(is_dir($config_dir)); $source_storage = new FileStorage($config_dir); $data = $source_storage->read($config_name); $this->assertIdentical($data, $expected_original_data); - // Verify that active configuration matches the expected data, which has - // been overriden by the testing install profile. + // Verify that active configuration matches the expected data, which was + // created from the testing install profile's system.cron.yml file. $config = \Drupal::config($config_name); - $this->assertIdentical($config->get(), $expected_overriden_data); + $this->assertIdentical($config->get(), $expected_profile_data); - // Turn on the test module, which will also attempt to override the - // configuration data, but should be prevented. + // Turn on the test module, which will attempt to replace the + // configuration data. This attempt to replace the active configuration + // should be ignored. \Drupal::moduleHandler()->install(array('config_override_test')); // Verify that the test module has not been able to change the data. $config = \Drupal::config($config_name); - $this->assertIdentical($config->get(), $expected_overriden_data); + $this->assertIdentical($config->get(), $expected_profile_data); // Disable and uninstall the test module. \Drupal::moduleHandler()->uninstall(array('config_override_test')); // Verify that the data hasn't been altered by removing the test module. $config = \Drupal::config($config_name); - $this->assertIdentical($config->get(), $expected_overriden_data); - - // Re-enable configuration overrides. - \Drupal::configFactory()->setOverrideState($old_state); + $this->assertIdentical($config->get(), $expected_profile_data); } - }