function StageBaseTest::testFailureCollectPathsToExcludeOnApply

Tests that if apply fails to get paths to exclude, throws a stage exception.

File

core/modules/package_manager/tests/src/Kernel/StageBaseTest.php, line 436

Class

StageBaseTest
@coversDefaultClass \Drupal\package_manager\StageBase @group package_manager @group #slow @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testFailureCollectPathsToExcludeOnApply() : void {
    $stage = $this->createStage();
    $stage->create();
    $stage->require([
        'drupal/random',
    ]);
    $this->expectException(StageException::class);
    $this->expectExceptionMessage("composer.json not found.");
    unlink($stage->getStageDirectory() . '/composer.json');
    $stage->apply();
}

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