Skip to content
Snippets Groups Projects
Commit 1f2d2fa4 authored by Ted Bowman's avatar Ted Bowman Committed by Adam G-H
Browse files

Issue #3251972 by tedbow, phenaproxima: Make...

Issue #3251972 by tedbow, phenaproxima: Make `\Drupal\package_manager\Stage::getStageDirectory` public
parent 6cc69f45
No related branches found
No related tags found
1 merge request!133Issue #3251972: Make `\Drupal\package_manager\Stage::getStageDirectory` public
......@@ -435,7 +435,7 @@ class Stage {
*
* @todo Make this method public in https://www.drupal.org/i/3251972.
*/
protected function getStageDirectory(): string {
public function getStageDirectory(): string {
if (!$this->lock) {
throw new \LogicException(__METHOD__ . '() cannot be called because the stage has not been created or claimed.');
}
......
<?php
namespace Drupal\Tests\package_manager\Kernel;
/**
* @coversDefaultClass \Drupal\package_manager\Stage
*
* @group package_manager
*/
class StageTest extends PackageManagerKernelTestBase {
/**
* @covers ::getStageDirectory
*/
public function testGetStageDirectory(): void {
$stage = $this->createStage();
$id = $stage->create();
$this->assertStringEndsWith("/.package_manager/$id", $stage->getStageDirectory());
}
/**
* @covers ::getStageDirectory
*/
public function testUncreatedGetStageDirectory(): void {
$this->expectException('LogicException');
$this->expectExceptionMessage('Drupal\package_manager\Stage::getStageDirectory() cannot be called because the stage has not been created or claimed.');
$this->createStage()->getStageDirectory();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment