diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php index 7116bea..56d9a01 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php @@ -136,14 +136,14 @@ function testInstallProfileConfigOverwrite() { // 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')); + \Drupal::moduleHandler()->install(array('config_existing_default_config_test')); // Verify that the test module has not been able to change the data. $config = \Drupal::config($config_name); $this->assertIdentical($config->get(), $expected_profile_data); // Disable and uninstall the test module. - \Drupal::moduleHandler()->uninstall(array('config_override_test')); + \Drupal::moduleHandler()->uninstall(array('config_existing_default_config_test')); // Verify that the data hasn't been altered by removing the test module. $config = \Drupal::config($config_name); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigModuleOverridesTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigModuleOverridesTest.php index c5c7190..1c358c5 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigModuleOverridesTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigModuleOverridesTest.php @@ -14,7 +14,7 @@ */ class ConfigModuleOverridesTest extends DrupalUnitTestBase { - public static $modules = array('system', 'config', 'config_override'); + public static $modules = array('system', 'config', 'config_override_test'); public static function getInfo() { return array( @@ -55,11 +55,11 @@ public function testSimpleModuleOverrides() { // Test overrides of completely new configuration objects. In normal runtime // this should only happen for configuration entities as we should not be // creating simple configuration objects on the fly. - $config = $config_factory->get('config_override.new'); - $this->assertTrue($config->isNew(), 'The configuration object config_override.new is new'); + $config = $config_factory->get('config_override_test.new'); + $this->assertTrue($config->isNew(), 'The configuration object config_override_test.new is new'); $this->assertIdentical($config->get('module'), 'override'); $config_factory->setOverrideState(FALSE); - $config = \Drupal::config('config_override.new'); + $config = \Drupal::config('config_override_test.new'); $this->assertIdentical($config->get('module'), NULL); $config_factory->setOverrideState($old_state); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigOtherModuleTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigOtherModuleTest.php index 9ba92da..c819cb6 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigOtherModuleTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigOtherModuleTest.php @@ -39,29 +39,29 @@ public function setUp() { * Tests enabling the provider of the default configuration first. */ public function testInstallOtherModuleFirst() { - $this->moduleHandler->install(array('config_other_module_config')); + $this->moduleHandler->install(array('config_other_module_config_test')); // Check that the config entity doesn't exist before the config_test module // is enabled. We cannot use the entity system because the config_test // entity type does not exist. - $config = $this->container->get('config.factory')->get('config_test.dynamic.other_module'); + $config = $this->container->get('config.factory')->get('config_test.dynamic.other_module_test'); $this->assertTrue($config->isNew(), 'Default configuration for other modules is not installed if that module is not enabled.'); // Install the module that provides the entity type. This installs the // default configuration. $this->moduleHandler->install(array('config_test')); - $this->assertTrue(entity_load('config_test', 'other_module', TRUE), 'Default configuration has been installed.'); + $this->assertTrue(entity_load('config_test', 'other_module_test', TRUE), 'Default configuration has been installed.'); // Uninstall the module that provides the entity type. This will remove the // default configuration. $this->moduleHandler->uninstall(array('config_test')); - $config = $this->container->get('config.factory')->get('config_test.dynamic.other_module'); + $config = $this->container->get('config.factory')->get('config_test.dynamic.other_module_test'); $this->assertTrue($config->isNew(), 'Default configuration for other modules is removed when the config entity provider is disabled.'); // Install the module that provides the entity type again. This installs the // default configuration. $this->moduleHandler->install(array('config_test')); - $other_module_config_entity = entity_load('config_test', 'other_module', TRUE); + $other_module_config_entity = entity_load('config_test', 'other_module_test', TRUE); $this->assertTrue($other_module_config_entity, "Default configuration has been recreated."); // Update the default configuration to test that the changes are preserved @@ -70,15 +70,15 @@ public function testInstallOtherModuleFirst() { $other_module_config_entity->save(); // Uninstall the module that provides the default configuration. - $this->moduleHandler->uninstall(array('config_other_module_config')); - $this->assertTrue(entity_load('config_test', 'other_module', TRUE), 'Default configuration for other modules is not removed when the module that provides it is uninstalled.'); + $this->moduleHandler->uninstall(array('config_other_module_config_test')); + $this->assertTrue(entity_load('config_test', 'other_module_test', TRUE), 'Default configuration for other modules is not removed when the module that provides it is uninstalled.'); // Default configuration provided by config_test should still exist. $this->assertTrue(entity_load('config_test', 'dotted.default', TRUE), 'The configuration is not deleted.'); // Re-enable module to test that default config is unchanged. - $this->moduleHandler->install(array('config_other_module_config')); - $config_entity = entity_load('config_test', 'other_module', TRUE); + $this->moduleHandler->install(array('config_other_module_config_test')); + $config_entity = entity_load('config_test', 'other_module_test', TRUE); $this->assertEqual($config_entity->get('style'), "The piano ain't got no wrong notes.", 'Re-enabling the module does not install default config over the existing config entity.'); } @@ -87,10 +87,10 @@ public function testInstallOtherModuleFirst() { */ public function testInstallConfigEnityModuleFirst() { $this->moduleHandler->install(array('config_test')); - $this->assertFalse(entity_load('config_test', 'other_module', TRUE), 'Default configuration provided by config_other_module_config does not exist.'); + $this->assertFalse(entity_load('config_test', 'other_module_test', TRUE), 'Default configuration provided by config_other_module_config_test does not exist.'); - $this->moduleHandler->install(array('config_other_module_config')); - $this->assertTrue(entity_load('config_test', 'other_module', TRUE), 'Default configuration provided by config_other_module_config has been installed.'); + $this->moduleHandler->install(array('config_other_module_config_test')); + $this->assertTrue(entity_load('config_test', 'other_module_test', TRUE), 'Default configuration provided by config_other_module_config_test has been installed.'); } /** diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigOverridesPriorityTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigOverridesPriorityTest.php index 6deab96..44a4180 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigOverridesPriorityTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigOverridesPriorityTest.php @@ -15,7 +15,7 @@ */ class ConfigOverridesPriorityTest extends DrupalUnitTestBase { - public static $modules = array('system', 'config', 'config_override', 'language'); + public static $modules = array('system', 'config', 'config_override_test', 'language'); public static function getInfo() { return array( diff --git a/core/modules/config/tests/config_existing_default_config_test/config/system.cron.yml b/core/modules/config/tests/config_existing_default_config_test/config/system.cron.yml new file mode 100644 index 0000000..79f797f --- /dev/null +++ b/core/modules/config/tests/config_existing_default_config_test/config/system.cron.yml @@ -0,0 +1,5 @@ +threshold: + autorun: 0 + requirements_warning: 172800 + requirements_error: 1209600 + diff --git a/core/modules/config/tests/config_existing_default_config_test/config_existing_default_config_test.yml b/core/modules/config/tests/config_existing_default_config_test/config_existing_default_config_test.yml new file mode 100644 index 0000000..4163a85 --- /dev/null +++ b/core/modules/config/tests/config_existing_default_config_test/config_existing_default_config_test.yml @@ -0,0 +1,6 @@ +name: 'Configuration existing default config test' +type: module +package: Testing +version: VERSION +core: 8.x +hidden: true diff --git a/core/modules/config/tests/config_other_module_config_test/config/config_test.dynamic.other_module_test.yml b/core/modules/config/tests/config_other_module_config_test/config/config_test.dynamic.other_module_test.yml new file mode 100644 index 0000000..a43f3a0 --- /dev/null +++ b/core/modules/config/tests/config_other_module_config_test/config/config_test.dynamic.other_module_test.yml @@ -0,0 +1,7 @@ +id: other_module_test +label: 'Other module test' +weight: 0 +style: '' +status: true +langcode: en +protected_property: Default diff --git a/core/modules/config/tests/config_other_module_config_test/config_other_module_config_test.info.yml b/core/modules/config/tests/config_other_module_config_test/config_other_module_config_test.info.yml new file mode 100644 index 0000000..0f78017 --- /dev/null +++ b/core/modules/config/tests/config_other_module_config_test/config_other_module_config_test.info.yml @@ -0,0 +1,6 @@ +name: 'Config other module config' +type: module +package: Testing +version: VERSION +core: 8.x +hidden: true diff --git a/core/modules/config/tests/config_override/config_override.services.yml b/core/modules/config/tests/config_override/config_override.services.yml deleted file mode 100644 index 5272a84..0000000 --- a/core/modules/config/tests/config_override/config_override.services.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - config_override.overrider: - class: Drupal\config_override\ConfigOverrider - tags: - - { name: config.factory.override} - config_override.low_priority_overrider: - class: Drupal\config_override\ConfigOverriderLowPriority - tags: - - { name: config.factory.override, priority: -100 } diff --git a/core/modules/config/tests/config_override_test/config_override_test.info.yml b/core/modules/config/tests/config_override_test/config_override_test.info.yml new file mode 100644 index 0000000..1ccb50b --- /dev/null +++ b/core/modules/config/tests/config_override_test/config_override_test.info.yml @@ -0,0 +1,6 @@ +name: 'Configuration override test' +type: module +package: Testing +version: VERSION +core: 8.x +hidden: true diff --git a/core/modules/config/tests/config_override_test/config_override_test.module b/core/modules/config/tests/config_override_test/config_override_test.module deleted file mode 100644 index f364ffb..0000000 --- a/core/modules/config/tests/config_override_test/config_override_test.module +++ /dev/null @@ -1,6 +0,0 @@ - array('name' => 'ZOMG overridden site name')); + } + if (in_array('config_override_test.new', $names)) { + $overrides = $overrides + array('config_override_test.new' => array('module' => 'override')); + } + } + return $overrides; + } + + /** + * {@inheritdoc} + */ + public function getCacheSuffix() { + return 'ConfigOverrider'; + } + +} + diff --git a/core/modules/config/tests/config_override_test/lib/Drupal/config_override_test/ConfigOverriderLowPriority.php b/core/modules/config/tests/config_override_test/lib/Drupal/config_override_test/ConfigOverriderLowPriority.php new file mode 100644 index 0000000..b1dd32d --- /dev/null +++ b/core/modules/config/tests/config_override_test/lib/Drupal/config_override_test/ConfigOverriderLowPriority.php @@ -0,0 +1,45 @@ + + array( + 'name' => 'Should not apply because of higher priority listener', + // This override should apply because it is not overridden by the + // higher priority listener. + 'slogan' => 'Yay for overrides!', + ) + ); + } + } + return $overrides; + } + + /** + * {@inheritdoc} + */ + public function getCacheSuffix() { + return 'ConfigOverriderLowPriority'; + } + +} +