Skip to content
Snippets Groups Projects

Fix getExpectedUnauthorizedEntityAccessCacheability

5 unresolved threads

Closes #3469843

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
829 829 return new CacheableMetadata();
830 830 }
831 831
832 /**
833 * The cacheability of unauthorized 'view' entity access.
834 *
835 * @param bool $is_authenticated
836 * Whether the current request is authenticated or not. This matters for
837 * some entity access control handlers, but not for most.
838 *
839 * @return \Drupal\Core\Cache\CacheableMetadata
840 * The expected cacheability.
841 */
842 protected function getExpectedUnauthorizedEntityAccessCacheability($is_authenticated) {
  • Should CookieResourceTestTrait be checking this method exists or defining this as abstract instead?

    Also if this doesn't get called ever, should it throw an exception instead?

  • quietone changed this line in version 2 of the diff

    changed this line in version 2 of the diff

  • Author Maintainer

    It is not just CookieResourceTestTrait it is also from BasicAuthResourceTestTrait. But while thinking about solutions I discovered that DbLogResourceTest had the same error message. That was fixed in [#3278052] with this commit. It seem reasonable to re-use that solution, so I copied/pasted it here and adjusted the comment.

  • Please register or sign in to reply
  • quietone added 120 commits

    added 120 commits

    Compare with previous version

  • quietone added 4 commits

    added 4 commits

    • 09f1d69f - 1 commit from branch project:11.x
    • e17f4606 - Fix getExpectedUnauthorizedEntityAccessCacheability
    • d13c0713 - same as DbLogResourceTest
    • 85c010cf - UserRegistrationRestTest

    Compare with previous version

  • 829 829 return new CacheableMetadata();
    830 830 }
    831 831
    832 /**
    833 * Empty function.
    834 *
    835 * Needed by PHPStan for unused function
    836 * BasicAuthResourceTestTrait::assertResponseWhenMissingAuthentication().
    837 * CookieResourceTestTrait::assertResponseWhenMissingAuthentication().
    838 */
    839 protected function getExpectedUnauthorizedEntityAccessCacheability($is_authenticated) {}
  • 269 269 return new CacheableMetadata();
    270 270 }
    271 271
    272 /**
    273 * Empty function.
    274 *
    275 * Needed by PHPStan for unused function
    276 * CookieResourceTestTrait::assertResponseWhenMissingAuthentication().
    277 */
    278 protected function getExpectedUnauthorizedEntityAccessCacheability($is_authenticated) {}
  • added 1 commit

    • eb1a6753 - Apply 2 suggestion(s) to 2 file(s)

    Compare with previous version

  • 829 829 return new CacheableMetadata();
    830 830 }
    831 831
    832 /**
    833 * Empty function.
    834 *
    835 * Needed by PHPStan for unused function
    836 * BasicAuthResourceTestTrait::assertResponseWhenMissingAuthentication().
    837 * CookieResourceTestTrait::assertResponseWhenMissingAuthentication().
    838 */
    839 protected function getExpectedUnauthorizedEntityAccessCacheability(bool $is_authenticated): void {}
  • 269 269 return new CacheableMetadata();
    270 270 }
    271 271
    272 /**
    273 * Empty function.
    274 *
    275 * Needed by PHPStan for unused function
    276 * CookieResourceTestTrait::assertResponseWhenMissingAuthentication().
    277 */
    278 protected function getExpectedUnauthorizedEntityAccessCacheability(bool $is_authenticated): void {}
  • added 1 commit

    • c8ed8b32 - Apply 2 suggestion(s) to 2 file(s)

    Compare with previous version

  • added 37 commits

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • quietone added 7 commits

    added 7 commits

    • b46912fd - Fix getExpectedUnauthorizedEntityAccessCacheability
    • 974af3ec - same as DbLogResourceTest
    • 79a717fd - UserRegistrationRestTest
    • 2cea124b - Apply 2 suggestion(s) to 2 file(s)
    • 2763a782 - Apply 2 suggestion(s) to 2 file(s)
    • e2163673 - #3469843 - Fix getExpectedUnauthorizedEntityAccessCacheability
    • 359aea13 - regenerate the baseline

    Compare with previous version

  • quietone added 9 commits

    added 9 commits

    • ba3a786b - 1 commit from branch project:11.x
    • e38db96b - Fix getExpectedUnauthorizedEntityAccessCacheability
    • 5841d488 - same as DbLogResourceTest
    • 5e00b731 - UserRegistrationRestTest
    • e86a9cc1 - Apply 2 suggestion(s) to 2 file(s)
    • 66818394 - Apply 2 suggestion(s) to 2 file(s)
    • f57736c4 - #3469843 - Fix getExpectedUnauthorizedEntityAccessCacheability
    • 3c3ecfd0 - regenerate the baseline
    • 006e27ef - add return

    Compare with previous version

  • quietone added 113 commits

    added 113 commits

    Compare with previous version

  • assigned to @quietone

  • unassigned @quietone

  • quietone added 10 commits

    added 10 commits

    Compare with previous version

  • Please register or sign in to reply
    Loading