diff --git a/core/modules/config/src/Tests/ConfigCRUDTest.php b/core/modules/config/src/Tests/ConfigCRUDTest.php index 4c3642e..f37f215 100644 --- a/core/modules/config/src/Tests/ConfigCRUDTest.php +++ b/core/modules/config/src/Tests/ConfigCRUDTest.php @@ -117,13 +117,26 @@ function testCRUD() { // Test renaming when config.factory does not have the object in its static // cache. + $config_factory = $this->container->get('config.factory'); $name = 'config_test.crud_rename'; + // Remove overrides. + $config_factory->setOverrideState(FALSE); + // Pollute the non overrides static cache. + \Drupal::config($name); + $config_factory->setOverrideState(TRUE); + // Pollute the overrides static cache. $config = \Drupal::config($name); $new_name = 'config_test.crud_rename_no_cache'; - $this->container->get('config.factory')->clearStaticCache()->rename($name, $new_name); + $config_factory->rename($name, $new_name); $renamed_config = \Drupal::config($new_name); $this->assertIdentical($renamed_config->get(), $config->get()); $this->assertIdentical($renamed_config->isNew(), FALSE); + // Ensure the overrides static cache has been cleared. + $this->assertIdentical(\Drupal::config($name)->isNew(), TRUE); + $config_factory->setOverrideState(FALSE); + // Ensure the non overrides static cache has been cleared. + $this->assertIdentical(\Drupal::config($name)->isNew(), TRUE); + $config_factory->setOverrideState(TRUE); // Merge data into the configuration object. $new_config = \Drupal::config($new_name);