Skip to content
Snippets Groups Projects

Issue #3252097: Remove PathLocator::getStageDirectory()

All threads resolved!
1 file
+ 24
19
Compare changes
  • Side-by-side
  • Inline
@@ -26,7 +26,7 @@ class FileSystemOperationsTest extends AutomaticUpdatesFunctionalTestBase {
@@ -26,7 +26,7 @@ class FileSystemOperationsTest extends AutomaticUpdatesFunctionalTestBase {
/**
/**
* The updater service under test.
* The updater service under test.
*
*
* @var \Drupal\automatic_updates\Updater
* @var \Drupal\Tests\automatic_updates\Functional\TestUpdater
*/
*/
private $updater;
private $updater;
@@ -58,7 +58,7 @@ class FileSystemOperationsTest extends AutomaticUpdatesFunctionalTestBase {
@@ -58,7 +58,7 @@ class FileSystemOperationsTest extends AutomaticUpdatesFunctionalTestBase {
$locator->getProjectRoot()->willReturn($drupal_root);
$locator->getProjectRoot()->willReturn($drupal_root);
$locator->getWebRoot()->willReturn('');
$locator->getWebRoot()->willReturn('');
$this->updater = new class(
$this->updater = new TestUpdater(
$locator->reveal(),
$locator->reveal(),
$this->container->get('package_manager.beginner'),
$this->container->get('package_manager.beginner'),
$this->container->get('package_manager.stager'),
$this->container->get('package_manager.stager'),
@@ -66,23 +66,7 @@ class FileSystemOperationsTest extends AutomaticUpdatesFunctionalTestBase {
@@ -66,23 +66,7 @@ class FileSystemOperationsTest extends AutomaticUpdatesFunctionalTestBase {
$this->container->get('file_system'),
$this->container->get('file_system'),
$this->container->get('event_dispatcher'),
$this->container->get('event_dispatcher'),
$this->container->get('tempstore.shared')
$this->container->get('tempstore.shared')
) extends Updater {
);
/**
* The directory where staging areas will be created.
*
* @var string
*/
public static $stagingRoot;
/**
* {@inheritdoc}
*/
protected static function getStagingRoot(): string {
return static::$stagingRoot;
}
};
$this->updater::$stagingRoot = $this->stageDir;
$this->updater::$stagingRoot = $this->stageDir;
// Use the public and private files directories in the fake site fixture.
// Use the public and private files directories in the fake site fixture.
@@ -141,3 +125,24 @@ class FileSystemOperationsTest extends AutomaticUpdatesFunctionalTestBase {
@@ -141,3 +125,24 @@ class FileSystemOperationsTest extends AutomaticUpdatesFunctionalTestBase {
}
}
}
}
 
 
/**
 
* A test-only version of the updater.
 
*/
 
class TestUpdater extends Updater {
 
 
/**
 
* The directory where staging areas will be created.
 
*
 
* @var string
 
*/
 
public static $stagingRoot;
 
 
/**
 
* {@inheritdoc}
 
*/
 
protected static function getStagingRoot(): string {
 
return static::$stagingRoot ?: parent::getStagingRoot();
 
}
 
 
}
Loading