Commit 7df65c4b authored by catch's avatar catch

Issue #1826244 by dawehner, damiankloip: Replace variable_get() usage in the tests with state().

parent 4cdc1cc1
......@@ -91,8 +91,8 @@ function testDynamicAccessPlugin() {
$view = $this->createViewFromConfig('test_access_dynamic');
$argument1 = $this->randomName();
$argument2 = $this->randomName();
variable_set('test_dynamic_access_argument1', $argument1);
variable_set('test_dynamic_access_argument2', $argument2);
state()->set('test_dynamic_access_argument1', $argument1);
state()->set('test_dynamic_access_argument2', $argument2);
$access_plugin = $view->display_handler->getPlugin('access');
......
......@@ -6,7 +6,6 @@
namespace Drupal\views\Tests;
use Drupal\views\ViewExecutable;
use Drupal\simpletest\WebTestBase;
/**
......@@ -42,8 +41,8 @@ protected function setUp() {
*/
protected function enableViewsTestModule() {
// Define the schema and views data variable before enabling the test module.
variable_set('views_test_data_schema', $this->schemaDefinition());
variable_set('views_test_data_views_data', $this->viewsData());
state()->set('views_test_data_schema', $this->schemaDefinition());
state()->set('views_test_data_views_data', $this->viewsData());
module_enable(array('views_test_data'));
$this->resetAll();
......
......@@ -30,7 +30,7 @@ protected function defineOptions() {
}
public function access($account) {
return !empty($this->options['access']) && isset($this->view->args[0]) && $this->view->args[0] == variable_get('test_dynamic_access_argument1', NULL) && isset($this->view->args[1]) && $this->view->args[1] == variable_get('test_dynamic_access_argument2', NULL);
return !empty($this->options['access']) && isset($this->view->args[0]) && $this->view->args[0] == state()->get('test_dynamic_access_argument1') && isset($this->view->args[1]) && $this->view->args[1] == state()->get('test_dynamic_access_argument2');
}
function get_access_callback() {
......
......@@ -9,7 +9,7 @@
* Implements hook_schema().
*/
function views_test_data_schema() {
return variable_get('views_test_data_schema', array());
return state()->get('views_test_data_schema');
}
/**
......
......@@ -23,7 +23,7 @@ function views_test_data_permission() {
* Implements hook_views_data().
*/
function views_test_data_views_data() {
return variable_get('views_test_data_views_data', array());
return state()->get('views_test_data_views_data');
}
function views_test_data_test_static_access_callback($access) {
......@@ -31,7 +31,7 @@ function views_test_data_test_static_access_callback($access) {
}
function views_test_data_test_dynamic_access_callback($access, $argument1, $argument2) {
return $access && $argument1 == variable_get('test_dynamic_access_argument1', NULL) && $argument2 == variable_get('test_dynamic_access_argument2', NULL);
return $access && $argument1 == state()->get('test_dynamic_access_argument1') && $argument2 == state()->get('test_dynamic_access_argument2');
}
/**+
......
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