function BlockResourceTestBase::getExpectedUnauthorizedAccessMessage

Same name in other branches
  1. 9 core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php \Drupal\Tests\block\Functional\Rest\BlockResourceTestBase::getExpectedUnauthorizedAccessMessage()
  2. 10 core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php \Drupal\Tests\block\Functional\Rest\BlockResourceTestBase::getExpectedUnauthorizedAccessMessage()
  3. 11.x core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php \Drupal\Tests\block\Functional\Rest\BlockResourceTestBase::getExpectedUnauthorizedAccessMessage()

Overrides EntityResourceTestBase::getExpectedUnauthorizedAccessMessage

File

core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php, line 134

Class

BlockResourceTestBase

Namespace

Drupal\Tests\block\Functional\Rest

Code

protected function getExpectedUnauthorizedAccessMessage($method) {
    if ($this->config('rest.settings')
        ->get('bc_entity_resource_permissions')) {
        return parent::getExpectedUnauthorizedAccessMessage($method);
    }
    switch ($method) {
        case 'GET':
            return "The block visibility condition 'user_role' denied access.";
        default:
            return parent::getExpectedUnauthorizedAccessMessage($method);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.