function LayoutRestTestBase::setUpAuthorization

Same name in other branches
  1. 9 core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php \Drupal\Tests\layout_builder\Functional\Rest\LayoutRestTestBase::setUpAuthorization()
  2. 8.9.x core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php \Drupal\Tests\layout_builder\Functional\Rest\LayoutRestTestBase::setUpAuthorization()
  3. 10 core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php \Drupal\Tests\layout_builder\Functional\Rest\LayoutRestTestBase::setUpAuthorization()

Overrides ResourceTestBase::setUpAuthorization

1 call to LayoutRestTestBase::setUpAuthorization()
LayoutRestTestBase::setUp in core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php

File

core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php, line 107

Class

LayoutRestTestBase
Base class for Layout Builder REST tests.

Namespace

Drupal\Tests\layout_builder\Functional\Rest

Code

protected function setUpAuthorization($method) {
    $permissions = array_keys($this->container
        ->get('user.permissions')
        ->getPermissions());
    // Give the test user all permissions on the site. There should be no
    // permission that gives the user access to layout sections over REST.
    $this->account = $this->drupalCreateUser($permissions);
}

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