Commit a4e1315e authored by webchick's avatar webchick

Issue #1848058 by ACF: Added Change system test variables to the state system.

parent 9d37ef53
......@@ -157,7 +157,8 @@ function testModuleEnableOrder() {
$this->assertModules(array('forum', 'poll', 'php', 'comment', 'history', 'taxonomy', 'options'), TRUE);
// Check the actual order which is saved by module_test_modules_enabled().
$this->assertIdentical(variable_get('test_module_enable_order', array()), $expected_order);
$module_order = state()->get('system_test.module_enable_order') ?: array();
$this->assertIdentical($module_order, $expected_order);
}
/**
......
......@@ -60,7 +60,7 @@ function testEnableDisable() {
// Set a variable so that the hook implementations in system_test.module
// will display messages via drupal_set_message().
variable_set('test_verbose_module_hooks', TRUE);
state()->set('system_test.verbose_module_hooks', TRUE);
// Go through each module in the list and try to enable it (unless it was
// already enabled automatically due to a dependency).
......
......@@ -176,7 +176,8 @@ function testDependencyResolution() {
// Verify that the original module was installed.
$this->assertTrue(module_exists('forum'), 'Module installation with unlisted dependencies succeeded.');
// Finally, verify that the modules were enabled in the correct order.
$this->assertEqual(variable_get('test_module_enable_order', array()), array('php', 'poll', 'forum'), 'Modules were enabled in the correct order by module_enable().');
$module_order = state()->get('system_test.module_enable_order') ?: array();
$this->assertEqual($module_order, array('php', 'poll', 'forum'), 'Modules were enabled in the correct order by module_enable().');
// Now, disable the PHP module. Both forum and poll should be disabled as
// well, in the correct order.
......@@ -239,7 +240,7 @@ function testDependencyResolution() {
// Verify that the original module was installed.
$this->assertTrue(module_exists('forum'), 'Module installation with version dependencies succeeded.');
// Finally, verify that the modules were enabled in the correct order.
$enable_order = variable_get('test_module_enable_order', array());
$enable_order = state()->get('system_test.module_enable_order') ?: array();
$php_position = array_search('php', $enable_order);
$poll_position = array_search('poll', $enable_order);
$forum_position = array_search('forum', $enable_order);
......
......@@ -40,7 +40,7 @@ function setUp() {
// Configure 'node' as front page.
config('system.site')->set('page.front', 'node')->save();
// Enable front page logging in system_test.module.
variable_set('front_page_output', 1);
state()->set('system_test.front_page_output', 1);
}
/**
......
......@@ -37,7 +37,7 @@ function image_test_reset() {
'crop' => array(),
'desaturate' => array(),
);
variable_set('image_test_results', $results);
state()->set('image_test.results', $results);
}
/**
......@@ -50,7 +50,7 @@ function image_test_reset() {
* passed to each call.
*/
function image_test_get_all_calls() {
return variable_get('image_test_results', array());
return state()->get('image_test.results') ?: array();
}
/**
......@@ -66,9 +66,9 @@ function image_test_get_all_calls() {
* @see image_test_reset()
*/
function _image_test_log_call($op, $args) {
$results = variable_get('image_test_results', array());
$results = state()->get('image_test.results') ?: array();
$results[$op][] = $args;
variable_set('image_test_results', $results);
state()->set('image_test.results', $results);
}
/**
......
......@@ -155,7 +155,7 @@ function module_test_class_loading() {
function module_test_modules_enabled($modules) {
// Record the ordered list of modules that were passed in to this hook so we
// can check that the modules were enabled in the correct sequence.
variable_set('test_module_enable_order', $modules);
state()->set('system_test.module_enable_order', $modules);
}
/**
......
......@@ -9,14 +9,14 @@
* Resets the path test results.
*/
function path_test_reset() {
variable_set('path_test_results', array());
state()->set('path_test.results', array());
}
/**
* Implements hook_path_update().
*/
function path_test_path_update($path) {
$results = variable_get('path_test_results', array());
$results = state()->get('path_test.results') ?: array();
$results['hook_path_update'] = $path;
variable_set('path_test_results', $results);
state()->set('path_test.results', $results);
}
......@@ -177,7 +177,7 @@ function system_test_redirect_invalid_scheme() {
* Implements hook_modules_installed().
*/
function system_test_modules_installed($modules) {
if (variable_get('test_verbose_module_hooks')) {
if (state()->get('system_test.verbose_module_hooks')) {
foreach ($modules as $module) {
drupal_set_message(t('hook_modules_installed fired for @module', array('@module' => $module)));
}
......@@ -188,7 +188,7 @@ function system_test_modules_installed($modules) {
* Implements hook_modules_enabled().
*/
function system_test_modules_enabled($modules) {
if (variable_get('test_verbose_module_hooks')) {
if (state()->get('system_test.verbose_module_hooks')) {
foreach ($modules as $module) {
drupal_set_message(t('hook_modules_enabled fired for @module', array('@module' => $module)));
}
......@@ -199,7 +199,7 @@ function system_test_modules_enabled($modules) {
* Implements hook_modules_disabled().
*/
function system_test_modules_disabled($modules) {
if (variable_get('test_verbose_module_hooks')) {
if (state()->get('system_test.verbose_module_hooks')) {
foreach ($modules as $module) {
drupal_set_message(t('hook_modules_disabled fired for @module', array('@module' => $module)));
}
......@@ -210,7 +210,7 @@ function system_test_modules_disabled($modules) {
* Implements hook_modules_uninstalled().
*/
function system_test_modules_uninstalled($modules) {
if (variable_get('test_verbose_module_hooks')) {
if (state()->get('system_test.verbose_module_hooks')) {
foreach ($modules as $module) {
drupal_set_message(t('hook_modules_uninstalled fired for @module', array('@module' => $module)));
}
......@@ -229,7 +229,8 @@ function system_test_boot() {
*/
function system_test_init() {
// Used by FrontPageTestCase to get the results of drupal_is_front_page().
if (variable_get('front_page_output', 0) && drupal_is_front_page()) {
$frontpage = state()->get('system_test.front_page_output') ?: 0;
if ($frontpage && drupal_is_front_page()) {
drupal_set_message(t('On front page.'));
}
}
......
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