function WorkspaceTest::getExpectedUnauthorizedAccessMessage
Return the expected error message.
Parameters
string $method: The HTTP method (GET, POST, PATCH, DELETE).
Return value
string The error string.
Overrides ResourceTestBase::getExpectedUnauthorizedAccessMessage
File
- 
              core/
modules/ jsonapi/ tests/ src/ Functional/ WorkspaceTest.php, line 233  
Class
- WorkspaceTest
 - JSON:API integration test for the "Workspace" content entity type.
 
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected function getExpectedUnauthorizedAccessMessage($method) : string {
  switch ($method) {
    case 'GET':
      return "The 'view own workspace' permission is required.";
    case 'POST':
      return "The following permissions are required: 'administer workspaces' OR 'create workspace'.";
    case 'PATCH':
      return "The 'edit own workspace' permission is required.";
    case 'DELETE':
      return "The 'delete own workspace' permission is required.";
    default:
      return parent::getExpectedUnauthorizedAccessMessage($method);
  }
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.