You are here

protected function CommentTest::getExpectedUnauthorizedAccessMessage in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/tests/src/Functional/CommentTest.php \Drupal\Tests\jsonapi\Functional\CommentTest::getExpectedUnauthorizedAccessMessage()
  2. 9 core/modules/jsonapi/tests/src/Functional/CommentTest.php \Drupal\Tests\jsonapi\Functional\CommentTest::getExpectedUnauthorizedAccessMessage()

File

core/modules/jsonapi/tests/src/Functional/CommentTest.php, line 291

Class

CommentTest
JSON:API integration test for the "Comment" content entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function getExpectedUnauthorizedAccessMessage($method) {
  switch ($method) {
    case 'GET':
      return "The 'access comments' permission is required and the comment must be published.";
    case 'POST':
      return "The 'post comments' permission is required.";
    case 'PATCH':
      return "The 'edit own comments' permission is required, the user must be the comment author, and the comment must be published.";
    default:
      return parent::getExpectedUnauthorizedAccessMessage($method);
  }
}