function ResourceTestBase::getExpectedUnauthorizedAccessMessage
Same name in this branch
- 10 core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::getExpectedUnauthorizedAccessMessage()
Same name in other branches
- 9 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::getExpectedUnauthorizedAccessMessage()
- 9 core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::getExpectedUnauthorizedAccessMessage()
- 8.9.x core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::getExpectedUnauthorizedAccessMessage()
- 8.9.x core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::getExpectedUnauthorizedAccessMessage()
- 11.x core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::getExpectedUnauthorizedAccessMessage()
- 11.x core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::getExpectedUnauthorizedAccessMessage()
Return the expected error message.
Parameters
string $method: The HTTP method (GET, POST, PATCH, DELETE).
Return value
string The error string.
16 calls to ResourceTestBase::getExpectedUnauthorizedAccessMessage()
- BlockTest::getExpectedUnauthorizedAccessMessage in core/
modules/ jsonapi/ tests/ src/ Functional/ BlockTest.php - Return the expected error message.
- CommentTest::getExpectedUnauthorizedAccessMessage in core/
modules/ jsonapi/ tests/ src/ Functional/ CommentTest.php - Return the expected error message.
- ConfigTestTest::getExpectedUnauthorizedAccessMessage in core/
modules/ jsonapi/ tests/ src/ Functional/ ConfigTestTest.php - Return the expected error message.
- EntityTestTest::getExpectedUnauthorizedAccessMessage in core/
modules/ jsonapi/ tests/ src/ Functional/ EntityTestTest.php - Return the expected error message.
- MenuLinkContentTest::getExpectedUnauthorizedAccessMessage in core/
modules/ jsonapi/ tests/ src/ Functional/ MenuLinkContentTest.php - Return the expected error message.
28 methods override ResourceTestBase::getExpectedUnauthorizedAccessMessage()
- BaseFieldOverrideTest::getExpectedUnauthorizedAccessMessage in core/
modules/ jsonapi/ tests/ src/ Functional/ BaseFieldOverrideTest.php - Return the expected error message.
- BlockContentTest::getExpectedUnauthorizedAccessMessage in core/
modules/ jsonapi/ tests/ src/ Functional/ BlockContentTest.php - Return the expected error message.
- BlockTest::getExpectedUnauthorizedAccessMessage in core/
modules/ jsonapi/ tests/ src/ Functional/ BlockTest.php - Return the expected error message.
- CommentTest::getExpectedUnauthorizedAccessMessage in core/
modules/ jsonapi/ tests/ src/ Functional/ CommentTest.php - Return the expected error message.
- ConfigTestTest::getExpectedUnauthorizedAccessMessage in core/
modules/ jsonapi/ tests/ src/ Functional/ ConfigTestTest.php - Return the expected error message.
File
-
core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceTestBase.php, line 645
Class
- ResourceTestBase
- Subclass this for every JSON:API resource type.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected function getExpectedUnauthorizedAccessMessage($method) {
$permission = $this->entity
->getEntityType()
->getAdminPermission();
if ($permission !== FALSE) {
return "The '{$permission}' permission is required.";
}
return NULL;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.