diff --git a/core/modules/config/tests/src/Functional/ConfigOtherModuleTest.php b/core/modules/config/tests/src/Functional/ConfigOtherModuleTest.php index 1a80f7f..0591f68 100644 --- a/core/modules/config/tests/src/Functional/ConfigOtherModuleTest.php +++ b/core/modules/config/tests/src/Functional/ConfigOtherModuleTest.php @@ -26,7 +26,9 @@ public function testInstallOtherModuleFirst() { // Install the module that provides the entity type. This installs the // default configuration. $this->installModule('config_test'); + /** @var \Drupal\Core\Entity\EntityStorageInterface $storage */ $storage = $this->container->get('entity_type.manager')->getStorage('config_test'); + $storage->resetCache(['other_module_test']); $this->assertTrue($storage->load('other_module_test'), 'Default configuration has been installed.'); // Uninstall the module that provides the entity type. This will remove the @@ -39,6 +41,7 @@ public function testInstallOtherModuleFirst() { // default configuration. $this->installModule('config_test'); $storage = $this->container->get('entity_type.manager')->getStorage('config_test'); + $storage->resetCache(['other_module_test']); $other_module_config_entity = $storage->load('other_module_test'); $this->assertTrue($other_module_config_entity, "Default configuration has been recreated."); @@ -50,10 +53,12 @@ public function testInstallOtherModuleFirst() { // Uninstall the module that provides the default configuration. $this->uninstallModule('config_other_module_config_test'); $storage = $this->container->get('entity_type.manager')->getStorage('config_test'); + $storage->resetCache(['other_module_test']); $this->assertTrue($storage->load('other_module_test'), '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. $storage = $this->container->get('entity_type.manager')->getStorage('config_test'); + $storage->resetCache(['dotted.default']); $this->assertTrue($storage->load('dotted.default'), 'The configuration is not deleted.'); // Re-enable module to test that pre-existing optional configuration does @@ -64,14 +69,18 @@ public function testInstallOtherModuleFirst() { // Ensure that optional configuration with unmet dependencies is only // installed once all the dependencies are met. $storage = $this->container->get('entity_type.manager')->getStorage('config_test'); + $storage->resetCache(['other_module_test_unmet']); $this->assertNull($storage->load('other_module_test_unmet'), 'The optional configuration config_test.dynamic.other_module_test_unmet whose dependencies are not met is not created.'); + $storage->resetCache(['other_module_test_optional_entity_unmet']); $this->assertNull($storage->load('other_module_test_optional_entity_unmet'), 'The optional configuration config_test.dynamic.other_module_test_optional_entity_unmet whose dependencies are not met is not created.'); $this->installModule('config_test_language'); $this->installModule('config_install_dependency_test'); $storage = $this->container->get('entity_type.manager')->getStorage('config_test'); + $storage->resetCache(['other_module_test_unmet']); $this->assertTrue($storage->load('other_module_test_unmet'), 'The optional configuration config_test.dynamic.other_module_test_unmet whose dependencies are met is now created.'); // Although the following configuration entity's are now met it is not // installed because it does not have a direct dependency on the // config_install_dependency_test module. + $storage->resetCache(['other_module_test_optional_entity_unmet']); $this->assertNull($storage->load('other_module_test_optional_entity_unmet'), 'The optional configuration config_test.dynamic.other_module_test_optional_entity_unmet whose dependencies are met is not created.'); } @@ -81,10 +90,12 @@ public function testInstallOtherModuleFirst() { public function testInstallConfigEntityModuleFirst() { $this->installModule('config_test'); $storage = $this->container->get('entity_type.manager')->getStorage('config_test'); + $storage->resetCache(['other_module_test']); $this->assertFalse($storage->load('other_module_test'), 'Default configuration provided by config_other_module_config_test does not exist.'); $this->installModule('config_other_module_config_test'); $storage = $this->container->get('entity_type.manager')->getStorage('config_test'); + $storage->resetCache(['other_module_test']); $this->assertTrue($storage->load('other_module_test'), 'Default configuration provided by config_other_module_config_test has been installed.'); }