diff --git a/core/lib/Drupal/Component/Scaffold/composer.json b/core/lib/Drupal/Component/Scaffold/composer.json index 6f77bf7ad0..0c49a9aaa4 100644 --- a/core/lib/Drupal/Component/Scaffold/composer.json +++ b/core/lib/Drupal/Component/Scaffold/composer.json @@ -23,5 +23,8 @@ }, "extra": { "class": "Drupal\\Component\\Scaffold\\Plugin" + }, + "suggest": { + "hirak/prestissimo": "Allow simultaneous downloads of multiple scaffold files." } } diff --git a/core/tests/Drupal/Tests/Component/Scaffold/FetcherTest.php b/core/tests/Drupal/Tests/Component/Scaffold/FetcherTest.php index 48f341a6c1..83148bdb04 100644 --- a/core/tests/Drupal/Tests/Component/Scaffold/FetcherTest.php +++ b/core/tests/Drupal/Tests/Component/Scaffold/FetcherTest.php @@ -7,6 +7,7 @@ use Composer\Util\RemoteFilesystem; use Drupal\Component\Scaffold\FileFetcher; use PHPUnit\Framework\TestCase; + /** * Unit tests for the Scaffold FileFetcher. * @@ -26,22 +27,10 @@ class FetcherTest extends TestCase { */ protected $tmpDir; - /** - * @var string - */ - protected $rootDir; - - /** - * @var string - */ - protected $tmpReleaseTag; - /** * SetUp test. */ public function setUp() { - $this->rootDir = realpath(realpath(__DIR__ . '/Scaffold')); - // Prepare temp directory. $this->fs = new Filesystem(); $this->tmpDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'drupal-scaffold'; diff --git a/core/tests/Drupal/Tests/Component/Scaffold/PluginTest.php b/core/tests/Drupal/Tests/Component/Scaffold/PluginTest.php index 92c4338edd..ad05822ed2 100644 --- a/core/tests/Drupal/Tests/Component/Scaffold/PluginTest.php +++ b/core/tests/Drupal/Tests/Component/Scaffold/PluginTest.php @@ -30,7 +30,7 @@ class PluginTest extends TestCase { protected $tmpDir; /** - * The root directory of the component within the Drupal codebase. + * The full path to the scaffold component within the Drupal codebase. * * @var string */ @@ -47,16 +47,23 @@ class PluginTest extends TestCase { * SetUp test. */ public function setUp() { + $this->fs = new Filesystem(); // @todo: Change this to be the component root dir when we start testing // components in isolation. // https://www.drupal.org/project/drupal/issues/2943856 $this->drupalRootDir = dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))); - // Get the root directory of the Scaffold component. + // Get the path to the Scaffold component. $this->componentRootDir = $this->drupalRootDir . '/core/lib/Drupal/Component/Scaffold'; - // Prepare temp directory. - $this->fs = new Filesystem(); - $this->tmpDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'drupal-scaffold'; + // Prepare temp directory. If the simpletest directory is present, then we + // want our temp dir to be inside it. + $this->tmpDir = $this->drupalRootDir . '/sites/simpletest'; + if (is_dir($this->tmpDir)) { + $this->tmpDir .= '/drupal-scaffold'; + } + else { + $this->tmpDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'drupal-scaffold'; + } $this->ensureDirectoryExistsAndClear($this->tmpDir); $this->writeComposerJSON();