summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2014-07-08 11:02:40 (GMT)
committerNathaniel Catchpole2014-07-08 11:02:40 (GMT)
commitcb5263f0e822211535796d01ed0dc7bad71b42fa (patch)
tree979b184ab22e0ed87a29947e829bbafd3af49762
parent8c90c366e07a5ed472ff1aff73440c647f47cb7a (diff)
Issue #2225485 by alexpott, gremy: Fix config test modules namespacing.
-rw-r--r--core/modules/config/src/Tests/ConfigInstallWebTest.php4
-rw-r--r--core/modules/config/src/Tests/ConfigModuleOverridesTest.php8
-rw-r--r--core/modules/config/src/Tests/ConfigOtherModuleTest.php24
-rw-r--r--core/modules/config/src/Tests/ConfigOverridesPriorityTest.php2
-rw-r--r--core/modules/config/tests/config_existing_default_config_test/config_existing_default_config_test.yml6
-rw-r--r--core/modules/config/tests/config_other_module_config_test/config/install/config_test.dynamic.other_module_test.yml (renamed from core/modules/config/tests/config_other_module_config/config/install/config_test.dynamic.other_module.yml)4
-rw-r--r--core/modules/config/tests/config_other_module_config_test/config_other_module_config_test.info.yml (renamed from core/modules/config/tests/config_other_module_config/config_other_module_config.info.yml)0
-rw-r--r--core/modules/config/tests/config_override/config_override.info.yml5
-rw-r--r--core/modules/config/tests/config_override/config_override.services.yml9
-rw-r--r--core/modules/config/tests/config_override_test/config_override_test.info.yml (renamed from core/modules/config/tests/config_override_test/config_override_test.yml)0
-rw-r--r--core/modules/config/tests/config_override_test/config_override_test.module6
-rw-r--r--core/modules/config/tests/config_override_test/config_override_test.services.yml9
-rw-r--r--core/modules/config/tests/config_override_test/src/ConfigOverrider.php (renamed from core/modules/config/tests/config_override/src/ConfigOverrider.php)12
-rw-r--r--core/modules/config/tests/config_override_test/src/ConfigOverriderLowPriority.php (renamed from core/modules/config/tests/config_override/src/ConfigOverriderLowPriority.php)4
-rw-r--r--core/modules/config/tests/config_test_invalid_name/config/install/invalid_object_name.yml1
-rw-r--r--core/modules/config/tests/config_test_invalid_name/config/schema/config_test_invalid_name.schema.yml9
-rw-r--r--core/modules/config/tests/config_test_invalid_name/install5
17 files changed, 42 insertions, 66 deletions
diff --git a/core/modules/config/src/Tests/ConfigInstallWebTest.php b/core/modules/config/src/Tests/ConfigInstallWebTest.php
index 776daa4..a3be696 100644
--- a/core/modules/config/src/Tests/ConfigInstallWebTest.php
+++ b/core/modules/config/src/Tests/ConfigInstallWebTest.php
@@ -137,14 +137,14 @@ class ConfigInstallWebTest extends WebTestBase {
// 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/src/Tests/ConfigModuleOverridesTest.php b/core/modules/config/src/Tests/ConfigModuleOverridesTest.php
index c5c7190..1c358c5 100644
--- a/core/modules/config/src/Tests/ConfigModuleOverridesTest.php
+++ b/core/modules/config/src/Tests/ConfigModuleOverridesTest.php
@@ -14,7 +14,7 @@ use Drupal\simpletest\DrupalUnitTestBase;
*/
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 @@ class ConfigModuleOverridesTest extends DrupalUnitTestBase {
// 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/src/Tests/ConfigOtherModuleTest.php b/core/modules/config/src/Tests/ConfigOtherModuleTest.php
index 9ba92da..c819cb6 100644
--- a/core/modules/config/src/Tests/ConfigOtherModuleTest.php
+++ b/core/modules/config/src/Tests/ConfigOtherModuleTest.php
@@ -39,29 +39,29 @@ class ConfigOtherModuleTest extends WebTestBase {
* 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 @@ class ConfigOtherModuleTest extends WebTestBase {
$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 @@ class ConfigOtherModuleTest extends WebTestBase {
*/
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/src/Tests/ConfigOverridesPriorityTest.php b/core/modules/config/src/Tests/ConfigOverridesPriorityTest.php
index 6deab96..44a4180 100644
--- a/core/modules/config/src/Tests/ConfigOverridesPriorityTest.php
+++ b/core/modules/config/src/Tests/ConfigOverridesPriorityTest.php
@@ -15,7 +15,7 @@ use Drupal\simpletest\DrupalUnitTestBase;
*/
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_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/config/install/config_test.dynamic.other_module.yml b/core/modules/config/tests/config_other_module_config_test/config/install/config_test.dynamic.other_module_test.yml
index b56ac6d..a43f3a0 100644
--- a/core/modules/config/tests/config_other_module_config/config/install/config_test.dynamic.other_module.yml
+++ b/core/modules/config/tests/config_other_module_config_test/config/install/config_test.dynamic.other_module_test.yml
@@ -1,5 +1,5 @@
-id: other_module
-label: 'Other module'
+id: other_module_test
+label: 'Other module test'
weight: 0
style: ''
status: true
diff --git a/core/modules/config/tests/config_other_module_config/config_other_module_config.info.yml b/core/modules/config/tests/config_other_module_config_test/config_other_module_config_test.info.yml
index 0c332c2..0c332c2 100644
--- a/core/modules/config/tests/config_other_module_config/config_other_module_config.info.yml
+++ b/core/modules/config/tests/config_other_module_config_test/config_other_module_config_test.info.yml
diff --git a/core/modules/config/tests/config_override/config_override.info.yml b/core/modules/config/tests/config_override/config_override.info.yml
deleted file mode 100644
index f1f1109..0000000
--- a/core/modules/config/tests/config_override/config_override.info.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-name: 'Configuration override test'
-type: module
-package: Testing
-version: VERSION
-core: 8.x
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.yml b/core/modules/config/tests/config_override_test/config_override_test.info.yml
index f1f1109..f1f1109 100644
--- a/core/modules/config/tests/config_override_test/config_override_test.yml
+++ b/core/modules/config/tests/config_override_test/config_override_test.info.yml
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 @@
-<?php
-
-/**
- * @file
- * Test module containing a configuration file which matches another module.
- */
diff --git a/core/modules/config/tests/config_override_test/config_override_test.services.yml b/core/modules/config/tests/config_override_test/config_override_test.services.yml
new file mode 100644
index 0000000..c3fae64
--- /dev/null
+++ b/core/modules/config/tests/config_override_test/config_override_test.services.yml
@@ -0,0 +1,9 @@
+services:
+ config_override_test.overrider:
+ class: Drupal\config_override_test\ConfigOverrider
+ tags:
+ - { name: config.factory.override}
+ config_override_test.low_priority_overrider:
+ class: Drupal\config_override_test\ConfigOverriderLowPriority
+ tags:
+ - { name: config.factory.override, priority: -100 }
diff --git a/core/modules/config/tests/config_override/src/ConfigOverrider.php b/core/modules/config/tests/config_override_test/src/ConfigOverrider.php
index 1da4ed7..8eb3836 100644
--- a/core/modules/config/tests/config_override/src/ConfigOverrider.php
+++ b/core/modules/config/tests/config_override_test/src/ConfigOverrider.php
@@ -2,16 +2,12 @@
/**
* @file
- * Contains \Drupal\config_override\ConfigOverrider.
+ * Contains \Drupal\config_override_test\ConfigOverrider.
*/
-namespace Drupal\config_override;
+namespace Drupal\config_override_test;
-use Drupal\Core\Config\ConfigEvents;
use Drupal\Core\Config\ConfigFactoryOverrideInterface;
-use Drupal\Core\Config\ConfigModuleOverridesEvent;
-use Drupal\Core\Config\StorageInterface;
-use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* Tests module overrides for configuration.
@@ -27,8 +23,8 @@ class ConfigOverrider implements ConfigFactoryOverrideInterface {
if (in_array('system.site', $names)) {
$overrides = $overrides + array('system.site' => array('name' => 'ZOMG overridden site name'));
}
- if (in_array('config_override.new', $names)) {
- $overrides = $overrides + array('config_override.new' => array('module' => 'override'));
+ if (in_array('config_override_test.new', $names)) {
+ $overrides = $overrides + array('config_override_test.new' => array('module' => 'override'));
}
}
return $overrides;
diff --git a/core/modules/config/tests/config_override/src/ConfigOverriderLowPriority.php b/core/modules/config/tests/config_override_test/src/ConfigOverriderLowPriority.php
index 16aa406..6b11e0a 100644
--- a/core/modules/config/tests/config_override/src/ConfigOverriderLowPriority.php
+++ b/core/modules/config/tests/config_override_test/src/ConfigOverriderLowPriority.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\config_override\ConfigOverriderLowPriority.
+ * Contains \Drupal\config_override_test\ConfigOverriderLowPriority.
*/
-namespace Drupal\config_override;
+namespace Drupal\config_override_test;
use Drupal\Core\Config\ConfigFactoryOverrideInterface;
use Drupal\Core\Config\StorageInterface;
diff --git a/core/modules/config/tests/config_test_invalid_name/config/install/invalid_object_name.yml b/core/modules/config/tests/config_test_invalid_name/config/install/invalid_object_name.yml
deleted file mode 100644
index f3f2ba0..0000000
--- a/core/modules/config/tests/config_test_invalid_name/config/install/invalid_object_name.yml
+++ /dev/null
@@ -1 +0,0 @@
-frittata: potato
diff --git a/core/modules/config/tests/config_test_invalid_name/config/schema/config_test_invalid_name.schema.yml b/core/modules/config/tests/config_test_invalid_name/config/schema/config_test_invalid_name.schema.yml
deleted file mode 100644
index 1f541b1..0000000
--- a/core/modules/config/tests/config_test_invalid_name/config/schema/config_test_invalid_name.schema.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-# Schema for the configuration files of the Invalid Configuration Name module.
-
-invalid_object_name:
- type: mapping
- label: 'Invalid configuration'
- mapping:
- frittata:
- type: string
- label: 'String'
diff --git a/core/modules/config/tests/config_test_invalid_name/install b/core/modules/config/tests/config_test_invalid_name/install
deleted file mode 100644
index 91ed0ae..0000000
--- a/core/modules/config/tests/config_test_invalid_name/install
+++ /dev/null
@@ -1,5 +0,0 @@
-name: 'Invalid configuration name'
-type: module
-package: Core
-version: VERSION
-core: 8.x