core/modules/aggregator/src/Tests/ItemCacheTagsTest.php | 2 +- core/modules/comment/src/Tests/CommentCacheTagsTest.php | 2 +- .../src/Tests/EntityReference/EntityReferenceFormatterTest.php | 4 ++-- core/modules/filter/src/Tests/FilterFormatAccessTest.php | 2 +- core/tests/Drupal/Tests/Core/Access/AccessResultTest.php | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/modules/aggregator/src/Tests/ItemCacheTagsTest.php b/core/modules/aggregator/src/Tests/ItemCacheTagsTest.php index c5198cb..fd6fdee 100644 --- a/core/modules/aggregator/src/Tests/ItemCacheTagsTest.php +++ b/core/modules/aggregator/src/Tests/ItemCacheTagsTest.php @@ -90,7 +90,7 @@ public function testEntityCreation() { */ protected function getAdditionalCacheContextsForEntity(EntityInterface $entity) { return [ - 'user.roles', + 'user.permissions', ]; } diff --git a/core/modules/comment/src/Tests/CommentCacheTagsTest.php b/core/modules/comment/src/Tests/CommentCacheTagsTest.php index 9ad5ace..d4710f5 100644 --- a/core/modules/comment/src/Tests/CommentCacheTagsTest.php +++ b/core/modules/comment/src/Tests/CommentCacheTagsTest.php @@ -87,7 +87,7 @@ protected function createEntity() { */ protected function getAdditionalCacheContextsForEntity(EntityInterface $entity) { return [ - 'user.roles', + 'user.permissions', ]; } diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php index f57503f..be2bf0d 100644 --- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php +++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php @@ -226,7 +226,7 @@ public function testLabelFormatter() { '#options' => $this->referencedEntity->urlInfo()->getOptions(), '#cache' => array( 'contexts' => [ - 'user.roles', + 'user.permissions', ], 'tags' => $this->referencedEntity->getCacheTags(), ), @@ -242,7 +242,7 @@ public function testLabelFormatter() { '#markup' => $this->unsavedReferencedEntity->label(), '#cache' => array( 'contexts' => [ - 'user.roles', + 'user.permissions', ], 'tags' => $this->unsavedReferencedEntity->getCacheTags(), 'max-age' => Cache::PERMANENT, diff --git a/core/modules/filter/src/Tests/FilterFormatAccessTest.php b/core/modules/filter/src/Tests/FilterFormatAccessTest.php index ccb5251..32d5d04 100644 --- a/core/modules/filter/src/Tests/FilterFormatAccessTest.php +++ b/core/modules/filter/src/Tests/FilterFormatAccessTest.php @@ -126,7 +126,7 @@ function testFormatPermissions() { $this->assertTrue($this->allowedFormat->access('use', $this->webUser), 'A regular user has access to use a text format they were granted access to.'); $this->assertEqual(AccessResult::allowed()->addCacheContexts(['user.permissions']), $this->allowedFormat->access('use', $this->webUser, TRUE), 'A regular user has access to use a text format they were granted access to.'); $this->assertFalse($this->disallowedFormat->access('use', $this->webUser), 'A regular user does not have access to use a text format they were not granted access to.'); - $this->assertEqual(AccessResult::neutral()->cachePerRole(), $this->disallowedFormat->access('use', $this->webUser, TRUE), 'A regular user does not have access to use a text format they were not granted access to.'); + $this->assertEqual(AccessResult::neutral()->cachePerPermissions(), $this->disallowedFormat->access('use', $this->webUser, TRUE), 'A regular user does not have access to use a text format they were not granted access to.'); $this->assertTrue($fallback_format->access('use', $this->webUser), 'A regular user has access to use the fallback format.'); $this->assertEqual(AccessResult::allowed(), $fallback_format->access('use', $this->webUser, TRUE), 'A regular user has access to use the fallback format.'); diff --git a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php index f7c1598..96dfc8b 100644 --- a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php +++ b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php @@ -829,15 +829,15 @@ public function testOrIfCacheabilityMerging() { $merge_both_directions = function(AccessResult $a, AccessResult $b) { // A globally cacheable access result. $a->setCacheable(TRUE); - // Another access result that is cacheable per role. - $b->setCacheable(TRUE)->cachePerRole(); + // Another access result that is cacheable per permissions. + $b->setCacheable(TRUE)->cachePerPermissions(); $r1 = $a->orIf($b); $this->assertTrue($r1->isCacheable()); - $this->assertSame(['user.roles'], $r1->getCacheContexts()); + $this->assertSame(['user.permissions'], $r1->getCacheContexts()); $r2 = $b->orIf($a); $this->assertTrue($r2->isCacheable()); - $this->assertSame(['user.roles'], $r2->getCacheContexts()); + $this->assertSame(['user.permissions'], $r2->getCacheContexts()); }; // Merge either direction, get the same result.