diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php index cb56a90..8a4ccf0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php @@ -132,7 +132,7 @@ function testModuleEnableOrder() { module_enable(array('module_test'), FALSE); $this->resetAll(); $this->assertModules(array('module_test'), TRUE); - variable_set('dependency_test', 'dependency'); + state()->set('module_test.dependency', 'dependency'); // module_test creates a dependency chain: // - forum depends on taxonomy, comment, history, and poll (via module_test) // - taxonomy depends on options diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php index f6e6929..02b05db 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php @@ -159,7 +159,7 @@ function testDependencyResolution() { // First, create a fake missing dependency. Forum depends on poll, which // depends on a made-up module, foo. Nothing should be installed. - variable_set('dependency_test', 'missing dependency'); + state()->set('module_test.dependency', 'missing dependency'); drupal_static_reset('system_rebuild_module_data'); $result = module_enable(array('forum')); $this->assertFalse($result, 'module_enable() returns FALSE if dependencies are missing.'); @@ -167,7 +167,7 @@ function testDependencyResolution() { // Now, fix the missing dependency. Forum module depends on poll, but poll // depends on the PHP module. module_enable() should work. - variable_set('dependency_test', 'dependency'); + state()->set('module_test.dependency', 'dependency'); drupal_static_reset('system_rebuild_module_data'); $result = module_enable(array('forum')); $this->assertTrue($result, 'module_enable() returns the correct value.'); @@ -230,7 +230,7 @@ function testDependencyResolution() { // php module. But, this time do it with poll module declaring a dependency // on a specific version of php module in its info file. Make sure that // module_enable() still works. - variable_set('dependency_test', 'version dependency'); + state()->set('module_test.dependency', 'version dependency'); drupal_static_reset('system_rebuild_module_data'); $result = module_enable(array('forum')); $this->assertTrue($result, 'module_enable() returns the correct value.'); diff --git a/core/modules/system/tests/modules/module_test/module_test.module b/core/modules/system/tests/modules/module_test/module_test.module index 69e5bfe..96ff2bd 100644 --- a/core/modules/system/tests/modules/module_test/module_test.module +++ b/core/modules/system/tests/modules/module_test/module_test.module @@ -15,7 +15,7 @@ function module_test_permission() { * Manipulate module dependencies to test dependency chains. */ function module_test_system_info_alter(&$info, $file, $type) { - if (variable_get('dependency_test', FALSE) == 'missing dependency') { + if (state()->get('module_test.dependency') == 'missing dependency') { if ($file->name == 'forum') { // Make forum module depend on poll. $info['dependencies'][] = 'poll'; @@ -25,7 +25,7 @@ function module_test_system_info_alter(&$info, $file, $type) { $info['dependencies'][] = 'foo'; } } - elseif (variable_get('dependency_test', FALSE) == 'dependency') { + elseif (state()->get('module_test.dependency') == 'dependency') { if ($file->name == 'forum') { // Make the forum module depend on poll. $info['dependencies'][] = 'poll'; @@ -35,7 +35,7 @@ function module_test_system_info_alter(&$info, $file, $type) { $info['dependencies'][] = 'php'; } } - elseif (variable_get('dependency_test', FALSE) == 'version dependency') { + elseif (state()->get('module_test.dependency') == 'version dependency') { if ($file->name == 'forum') { // Make the forum module depend on poll. $info['dependencies'][] = 'poll';