Commit 1a0793da authored by catch's avatar catch
Browse files

Issue #1814402 by Lars Toomre, moe4715: Convert 'node_access_test_private()'...

Issue #1814402 by Lars Toomre, moe4715: Convert 'node_access_test_private()' variable to state() system.
parent b1933997
...@@ -27,10 +27,10 @@ public static function getInfo() { ...@@ -27,10 +27,10 @@ public static function getInfo() {
); );
} }
function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
node_access_rebuild(); node_access_rebuild();
variable_set('node_access_test_private', TRUE); state()->set('node_access_test.private', TRUE);
} }
/** /**
......
...@@ -36,7 +36,7 @@ public static function getInfo() { ...@@ -36,7 +36,7 @@ public static function getInfo() {
function setUp() { function setUp() {
parent::setUp(); parent::setUp();
node_access_rebuild(); node_access_rebuild();
variable_set('node_access_test_private', TRUE); state()->set('node_access_test.private', TRUE);
} }
/** /**
......
...@@ -37,7 +37,7 @@ public function setUp() { ...@@ -37,7 +37,7 @@ public function setUp() {
parent::setUp(); parent::setUp();
node_access_rebuild(); node_access_rebuild();
variable_set('node_access_test_private', TRUE); state()->set('node_access_test.private', TRUE);
} }
/** /**
......
...@@ -33,7 +33,7 @@ function node_access_test_node_grants($account, $op) { ...@@ -33,7 +33,7 @@ function node_access_test_node_grants($account, $op) {
function node_access_test_node_access_records(Node $node) { function node_access_test_node_access_records(Node $node) {
$grants = array(); $grants = array();
// For NodeAccessBaseTableTestCase, only set records for private nodes. // For NodeAccessBaseTableTestCase, only set records for private nodes.
if (!variable_get('node_access_test_private') || $node->private) { if (!state()->get('node_access_test.private') || $node->private) {
$grants[] = array( $grants[] = array(
'realm' => 'node_access_test', 'realm' => 'node_access_test',
'gid' => 8888, 'gid' => 8888,
...@@ -180,7 +180,7 @@ function node_access_entity_test_page() { ...@@ -180,7 +180,7 @@ function node_access_entity_test_page() {
*/ */
function node_access_test_form_node_form_alter(&$form, $form_state) { function node_access_test_form_node_form_alter(&$form, $form_state) {
// Only show this checkbox for NodeAccessBaseTableTestCase. // Only show this checkbox for NodeAccessBaseTableTestCase.
if (variable_get('node_access_test_private')) { if (state()->get('node_access_test.private')) {
$node = $form_state['controller']->getEntity($form_state); $node = $form_state['controller']->getEntity($form_state);
$form['private'] = array( $form['private'] = array(
'#type' => 'checkbox', '#type' => 'checkbox',
......
...@@ -35,10 +35,9 @@ public static function getInfo() { ...@@ -35,10 +35,9 @@ public static function getInfo() {
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
node_access_rebuild(); node_access_rebuild();
variable_set('node_access_test_private', TRUE); state()->set('node_access_test.private', TRUE);
} }
/** /**
* Ensure private node on /tracker is only visible to users with permission. * Ensure private node on /tracker is only visible to users with permission.
*/ */
......
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