function PackageManagerKernelTestBase::setUp

File

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

Class

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

Namespace

Drupal\Tests\package_manager\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->installConfig('package_manager');
    $this->fileSystem = new Filesystem();
    $this->createTestProject();
    // The Update module's default configuration must be installed for our
    // fake release metadata to be fetched, and the System module's to ensure
    // the site has a name.
    $this->installConfig([
        'system',
        'update',
    ]);
    // Make the update system think that all of System's post-update functions
    // have run.
    $this->registerPostUpdateFunctions();
    // Ensure we can fail the test if any warnings, or worse, are logged by
    // Package Manager.
    // @see ::tearDown()
    $this->failureLogger = new TestLogger();
    $this->container
        ->get('logger.channel.package_manager')
        ->addLogger($this->failureLogger);
}

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