Commit 56bf9226 authored by alexpott's avatar alexpott

Issue #2465005 by Berdir: PHP Strict Standards in NodeAccessGrantsCacheContextTest

parent eb4e3719
......@@ -65,7 +65,7 @@ protected function setUp() {
* @param array $expected
* Expected values, keyed by user ID, expected cache contexts as values.
*/
protected function assertCacheContext(array $expected) {
protected function assertUserCacheContext(array $expected) {
foreach ($expected as $uid => $context) {
if ($uid > 0) {
$this->drupalLogin($this->userMapping[$uid]);
......@@ -80,7 +80,7 @@ protected function assertCacheContext(array $expected) {
* Tests NodeAccessGrantsCacheContext::getContext().
*/
public function testCacheContext() {
$this->assertCacheContext([
$this->assertUserCacheContext([
0 => 'view.all:0;node_access_test_author:0;node_access_all:0',
1 => 'all',
2 => 'view.all:0;node_access_test_author:2;node_access_test:8888,8889',
......@@ -102,7 +102,7 @@ public function testCacheContext() {
// Put user accessUser (uid 0) in the realm.
\Drupal::state()->set('node_access_test.no_access_uid', 0);
drupal_static_reset('node_access_view_all_nodes');
$this->assertCacheContext([
$this->assertUserCacheContext([
0 => 'view.all',
1 => 'all',
2 => 'view.all:0;node_access_test_author:2;node_access_test:8888,8889',
......@@ -112,7 +112,7 @@ public function testCacheContext() {
// Put user accessUser (uid 2) in the realm.
\Drupal::state()->set('node_access_test.no_access_uid', $this->accessUser->id());
drupal_static_reset('node_access_view_all_nodes');
$this->assertCacheContext([
$this->assertUserCacheContext([
0 => 'view.all:0;node_access_test_author:0',
1 => 'all',
2 => 'view.all',
......@@ -122,7 +122,7 @@ public function testCacheContext() {
// Put user noAccessUser (uid 3) in the realm.
\Drupal::state()->set('node_access_test.no_access_uid', $this->noAccessUser->id());
drupal_static_reset('node_access_view_all_nodes');
$this->assertCacheContext([
$this->assertUserCacheContext([
0 => 'view.all:0;node_access_test_author:0',
1 => 'all',
2 => 'view.all:0;node_access_test_author:2;node_access_test:8888,8889',
......@@ -132,7 +132,7 @@ public function testCacheContext() {
// Uninstall the node_access_test module
$this->container->get('module_installer')->uninstall(['node_access_test']);
drupal_static_reset('node_access_view_all_nodes');
$this->assertCacheContext([
$this->assertUserCacheContext([
0 => 'view.all',
1 => 'all',
2 => 'view.all',
......
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