protected function WorkspaceResourceTestBase::getExpectedUnauthorizedAccessMessage in Workspace 8.2
Return the expected error message.
Parameters
string $method: The HTTP method (GET, POST, PATCH, DELETE).
Return value
string The error string.
Overrides EntityResourceTestBase::getExpectedUnauthorizedAccessMessage
File
- tests/
src/ Functional/ EntityResource/ WorkspaceResourceTestBase.php, line 188
Class
- WorkspaceResourceTestBase
- Base class for workspace EntityResource tests.
Namespace
Drupal\Tests\workspace\Functional\EntityResourceCode
protected function getExpectedUnauthorizedAccessMessage($method) {
if ($this
->config('rest.settings')
->get('bc_entity_resource_permissions')) {
return parent::getExpectedUnauthorizedAccessMessage($method);
}
switch ($method) {
case 'GET':
return "The 'view any workspace' permission is required.";
break;
case 'POST':
return "The 'create workspace' permission is required.";
break;
case 'PATCH':
return "The 'edit any workspace' permission is required.";
break;
case 'DELETE':
return "The 'delete any workspace' permission is required.";
break;
}
return parent::getExpectedUnauthorizedAccessMessage($method);
}