You are here

protected function SearchPageResourceTestBase::getExpectedUnauthorizedAccessMessage in Drupal 10

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

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

core/modules/search/tests/src/Functional/Rest/SearchPageResourceTestBase.php, line 89

Class

SearchPageResourceTestBase

Namespace

Drupal\Tests\search\Functional\Rest

Code

protected function getExpectedUnauthorizedAccessMessage($method) {
  switch ($method) {
    case 'GET':
      return "The 'access content' permission is required.";
    default:
      return parent::getExpectedUnauthorizedAccessMessage($method);
  }
}