You are here

public function CartAccessApiResourceTest::setUp in Commerce Cart API 8

Overrides CartResourceTestBase::setUp

File

tests/src/Functional/CartAccessApiResourceTest.php, line 25

Class

CartAccessApiResourceTest
Tests cart api access check.

Namespace

Drupal\Tests\commerce_cart_api\Functional

Code

public function setUp() {
  parent::setUp();

  // Parent will provision resource for canonical; need others here.
  $auth = isset(static::$auth) ? [
    static::$auth,
  ] : [];
  self::$resourceConfigId = 'commerce_cart_collection';
  $this
    ->provisionResource([
    static::$format,
  ], $auth);
  self::$resourceConfigId = 'commerce_cart_update_item';
  $this
    ->provisionResource([
    static::$format,
  ], $auth);
  $this
    ->initAuthentication();
  $this
    ->setUpAuthorization('GET');
  $this
    ->setUpAuthorization('PATCH');
}