function ModeratedNodeResourceTestBase::setUpAuthorization

Same name in other branches
  1. 9 core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\ModeratedNode\ModeratedNodeResourceTestBase::setUpAuthorization()
  2. 10 core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\ModeratedNode\ModeratedNodeResourceTestBase::setUpAuthorization()
  3. 11.x core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\ModeratedNode\ModeratedNodeResourceTestBase::setUpAuthorization()

Overrides NodeResourceTestBase::setUpAuthorization

File

core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeResourceTestBase.php, line 30

Class

ModeratedNodeResourceTestBase
Extend the Node resource test base and apply moderation to the entity.

Namespace

Drupal\Tests\rest\Functional\EntityResource\ModeratedNode

Code

protected function setUpAuthorization($method) {
    parent::setUpAuthorization($method);
    switch ($method) {
        case 'POST':
        case 'PATCH':
        case 'DELETE':
            $this->grantPermissionsToTestedRole([
                'use editorial transition publish',
                'use editorial transition create_new_draft',
            ]);
            break;
    }
}

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