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 42924bf..e88d0ff 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php @@ -184,7 +184,8 @@ function testDependencyResolution() { module_disable(array('php')); $this->assertTrue(!module_exists('forum') && !module_exists('poll'), 'Depedency chain was disabled by module_disable().'); $this->assertFalse(module_exists('php'), 'Disabling a module with unlisted dependents succeeded.'); - $this->assertEqual(variable_get('test_module_disable_order', array()), array('forum', 'poll', 'php'), 'Modules were disabled in the correct order by module_disable().'); + $disabled_modules = state()->get('module_test.disable_order') ?: array(); + $this->assertEqual($disabled_modules, array('forum', 'poll', 'php'), 'Modules were disabled in the correct order by module_disable().'); // Disable a module that is listed as a dependency by the installation // profile. Make sure that the profile itself is not on the list of @@ -195,7 +196,7 @@ function testDependencyResolution() { $this->assertTrue(module_exists('comment'), 'Comment module is enabled.'); module_disable(array('comment')); $this->assertFalse(module_exists('comment'), 'Comment module was disabled.'); - $disabled_modules = variable_get('test_module_disable_order', array()); + $disabled_modules = state()->get('module_test.disable_order') ?: array(); $this->assertTrue(in_array('comment', $disabled_modules), 'Comment module is in the list of disabled modules.'); $this->assertFalse(in_array($profile, $disabled_modules), 'The installation profile is not in the list of disabled modules.'); 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 7162b1b..6b8f428 100644 --- a/core/modules/system/tests/modules/module_test/module_test.module +++ b/core/modules/system/tests/modules/module_test/module_test.module @@ -164,7 +164,7 @@ function module_test_modules_enabled($modules) { function module_test_modules_disabled($modules) { // Record the ordered list of modules that were passed in to this hook so we // can check that the modules were disabled in the correct sequence. - variable_set('test_module_disable_order', $modules); + state()->set('module_test.disable_order', $modules); } /**