Commit ce051755 authored by webchick's avatar webchick

Issue #1843452 by ACF: Change dependency_test() variable to state system.

parent 7a9c8d86
......@@ -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
......
......@@ -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.');
......
......@@ -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';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment