function StageOwnershipTest::testStageOwnedByCreator

Tests that the stage is owned by the person who calls create() on it.

File

core/modules/package_manager/tests/src/Kernel/StageOwnershipTest.php, line 132

Class

StageOwnershipTest
Tests that ownership of the stage is enforced.

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testStageOwnedByCreator() : void {
  // Even if the stage is instantiated before anyone is logged in, it should
  // still be owned (and claimable) by the user who called create() on it.
  $stage = $this->createStage();
  $account = $this->createUser([], NULL, FALSE, [
    'uid' => 2,
  ]);
  $this->setCurrentUser($account);
  $id = $stage->create();
  $this->createStage()
    ->claim($id);
}

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