function PackageManagerKernelTestBase::createStage

Creates a stage object for testing purposes.

Parameters

class-string $class: (optional) The class of the sandbox manager to create. Defaults to \Drupal\Tests\package_manager\Kernel\TestSandboxManager.

Return value

\Drupal\Tests\package_manager\Kernel\TestSandboxManager A stage object, with test-only modifications.

60 calls to PackageManagerKernelTestBase::createStage()
ChangeLoggerTest::testChangeLogging in core/modules/package_manager/tests/src/Kernel/ChangeLoggerTest.php
Tests that the requested and applied changes are logged.
ComposerMinimumStabilityValidatorTest::testPreRequireEvent in core/modules/package_manager/tests/src/Kernel/ComposerMinimumStabilityValidatorTest.php
Tests error if requested version is less stable than the minimum: stable.
ComposerPatchesValidatorTest::testErrorDuringPreApply in core/modules/package_manager/tests/src/Kernel/ComposerPatchesValidatorTest.php
Tests the patcher's presence and configuration are validated on pre-apply.
ComposerPluginsValidatorInsecureTest::testAddDisallowedPlugin in core/modules/package_manager/tests/src/Kernel/ComposerPluginsValidatorInsecureTest.php
Tests adding a plugin that's not allowed by the allow-plugins config.
DirectWriteTest::testDirectWriteFlagIsLocked in core/modules/package_manager/tests/src/Kernel/DirectWriteTest.php
Tests that the sandbox's direct-write status is part of its locking info.

... See full list

File

core/modules/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php, line 184

Class

PackageManagerKernelTestBase
Base class for kernel tests of Package Manager's functionality.

Namespace

Drupal\Tests\package_manager\Kernel

Code

protected function createStage(?string $class = TestSandboxManager::class) : TestSandboxManager {
  return new $class($this->container
    ->get(PathLocator::class), $this->container
    ->get(BeginnerInterface::class), $this->container
    ->get(StagerInterface::class), $this->container
    ->get(CommitterInterface::class), $this->container
    ->get(QueueFactory::class), $this->container
    ->get('event_dispatcher'), $this->container
    ->get('tempstore.shared'), $this->container
    ->get('datetime.time'), $this->container
    ->get(PathFactoryInterface::class), $this->container
    ->get(FailureMarker::class));
}

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