diff --git a/composer.json b/composer.json
index cd23264660..ba39243944 100644
--- a/composer.json
+++ b/composer.json
@@ -60,5 +60,8 @@
"type": "composer",
"url": "https://packages.drupal.org/8"
}
- ]
+ ],
+ "require-dev": {
+ "composer/composer": "^1.8"
+ }
}
diff --git a/composer.lock b/composer.lock
index 41e5a866f1..b26726364f 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "d764df12b2cff2be49d45e95ecbeb5d7",
+ "content-hash": "d893afc1da2c9fa30925841809a51e05",
"packages": [
{
"name": "asm89/stack-cors",
@@ -3026,6 +3026,247 @@
],
"time": "2018-01-07T19:17:08+00:00"
},
+ {
+ "name": "composer/ca-bundle",
+ "version": "1.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/ca-bundle.git",
+ "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8afa52cd417f4ec417b4bfe86b68106538a87660",
+ "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660",
+ "shasum": ""
+ },
+ "require": {
+ "ext-openssl": "*",
+ "ext-pcre": "*",
+ "php": "^5.3.2 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5",
+ "psr/log": "^1.0",
+ "symfony/process": "^2.5 || ^3.0 || ^4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\CaBundle\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.",
+ "keywords": [
+ "cabundle",
+ "cacert",
+ "certificate",
+ "ssl",
+ "tls"
+ ],
+ "time": "2018-10-18T06:09:13+00:00"
+ },
+ {
+ "name": "composer/composer",
+ "version": "1.8.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/composer.git",
+ "reference": "d8aef3af866b28786ce9b8647e52c42496436669"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/composer/zipball/d8aef3af866b28786ce9b8647e52c42496436669",
+ "reference": "d8aef3af866b28786ce9b8647e52c42496436669",
+ "shasum": ""
+ },
+ "require": {
+ "composer/ca-bundle": "^1.0",
+ "composer/semver": "^1.0",
+ "composer/spdx-licenses": "^1.2",
+ "composer/xdebug-handler": "^1.1",
+ "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0",
+ "php": "^5.3.2 || ^7.0",
+ "psr/log": "^1.0",
+ "seld/jsonlint": "^1.4",
+ "seld/phar-utils": "^1.0",
+ "symfony/console": "^2.7 || ^3.0 || ^4.0",
+ "symfony/filesystem": "^2.7 || ^3.0 || ^4.0",
+ "symfony/finder": "^2.7 || ^3.0 || ^4.0",
+ "symfony/process": "^2.7 || ^3.0 || ^4.0"
+ },
+ "conflict": {
+ "symfony/console": "2.8.38"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7",
+ "phpunit/phpunit-mock-objects": "^2.3 || ^3.0"
+ },
+ "suggest": {
+ "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages",
+ "ext-zip": "Enabling the zip extension allows you to unzip archives",
+ "ext-zlib": "Allow gzip compression of HTTP requests"
+ },
+ "bin": [
+ "bin/composer"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\": "src/Composer"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nils Adermann",
+ "email": "naderman@naderman.de",
+ "homepage": "http://www.naderman.de"
+ },
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.",
+ "homepage": "https://getcomposer.org/",
+ "keywords": [
+ "autoload",
+ "dependency",
+ "package"
+ ],
+ "time": "2018-12-03T09:31:16+00:00"
+ },
+ {
+ "name": "composer/spdx-licenses",
+ "version": "1.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/spdx-licenses.git",
+ "reference": "7a9556b22bd9d4df7cad89876b00af58ef20d3a2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/7a9556b22bd9d4df7cad89876b00af58ef20d3a2",
+ "reference": "7a9556b22bd9d4df7cad89876b00af58ef20d3a2",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.2 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5",
+ "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\Spdx\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nils Adermann",
+ "email": "naderman@naderman.de",
+ "homepage": "http://www.naderman.de"
+ },
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ },
+ {
+ "name": "Rob Bast",
+ "email": "rob.bast@gmail.com",
+ "homepage": "http://robbast.nl"
+ }
+ ],
+ "description": "SPDX licenses list and validation library.",
+ "keywords": [
+ "license",
+ "spdx",
+ "validator"
+ ],
+ "time": "2018-11-01T09:45:54+00:00"
+ },
+ {
+ "name": "composer/xdebug-handler",
+ "version": "1.3.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/xdebug-handler.git",
+ "reference": "dc523135366eb68f22268d069ea7749486458562"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/dc523135366eb68f22268d069ea7749486458562",
+ "reference": "dc523135366eb68f22268d069ea7749486458562",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.2 || ^7.0",
+ "psr/log": "^1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Composer\\XdebugHandler\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "John Stevenson",
+ "email": "john-stevenson@blueyonder.co.uk"
+ }
+ ],
+ "description": "Restarts a process without xdebug.",
+ "keywords": [
+ "Xdebug",
+ "performance"
+ ],
+ "time": "2018-11-29T10:59:02+00:00"
+ },
{
"name": "doctrine/instantiator",
"version": "1.0.5",
@@ -3382,6 +3623,72 @@
],
"time": "2016-10-04T09:27:04+00:00"
},
+ {
+ "name": "justinrainbow/json-schema",
+ "version": "5.2.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/justinrainbow/json-schema.git",
+ "reference": "8560d4314577199ba51bf2032f02cd1315587c23"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8560d4314577199ba51bf2032f02cd1315587c23",
+ "reference": "8560d4314577199ba51bf2032f02cd1315587c23",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^2.1",
+ "json-schema/json-schema-test-suite": "1.2.0",
+ "phpunit/phpunit": "^4.8.35"
+ },
+ "bin": [
+ "bin/validate-json"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "JsonSchema\\": "src/JsonSchema/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Bruno Prieto Reis",
+ "email": "bruno.p.reis@gmail.com"
+ },
+ {
+ "name": "Justin Rainbow",
+ "email": "justin.rainbow@gmail.com"
+ },
+ {
+ "name": "Igor Wiedler",
+ "email": "igor@wiedler.ch"
+ },
+ {
+ "name": "Robert Schönthal",
+ "email": "seroscho@googlemail.com"
+ }
+ ],
+ "description": "A library to validate a json schema.",
+ "homepage": "https://github.com/justinrainbow/json-schema",
+ "keywords": [
+ "json",
+ "schema"
+ ],
+ "time": "2018-02-14T22:26:30+00:00"
+ },
{
"name": "mikey179/vfsStream",
"version": "v1.6.5",
@@ -4288,6 +4595,99 @@
"homepage": "https://github.com/sebastianbergmann/version",
"time": "2015-06-21T13:59:46+00:00"
},
+ {
+ "name": "seld/jsonlint",
+ "version": "1.7.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Seldaek/jsonlint.git",
+ "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/d15f59a67ff805a44c50ea0516d2341740f81a38",
+ "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ },
+ "bin": [
+ "bin/jsonlint"
+ ],
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Seld\\JsonLint\\": "src/Seld/JsonLint/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "JSON Linter",
+ "keywords": [
+ "json",
+ "linter",
+ "parser",
+ "validator"
+ ],
+ "time": "2018-01-24T12:46:19+00:00"
+ },
+ {
+ "name": "seld/phar-utils",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Seldaek/phar-utils.git",
+ "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a",
+ "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Seld\\PharUtils\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be"
+ }
+ ],
+ "description": "PHAR file format utilities, for when PHP phars you up",
+ "keywords": [
+ "phra"
+ ],
+ "time": "2015-10-13T18:44:15+00:00"
+ },
{
"name": "squizlabs/php_codesniffer",
"version": "2.8.1",
@@ -4533,6 +4933,105 @@
"homepage": "https://symfony.com",
"time": "2018-07-26T10:03:52+00:00"
},
+ {
+ "name": "symfony/filesystem",
+ "version": "v4.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/filesystem.git",
+ "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/2f4c8b999b3b7cadb2a69390b01af70886753710",
+ "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3",
+ "symfony/polyfill-ctype": "~1.8"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Filesystem\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Filesystem Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-11-11T19:52:12+00:00"
+ },
+ {
+ "name": "symfony/finder",
+ "version": "v4.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/finder.git",
+ "reference": "e53d477d7b5c4982d0e1bfd2298dbee63d01441d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/e53d477d7b5c4982d0e1bfd2298dbee63d01441d",
+ "reference": "e53d477d7b5c4982d0e1bfd2298dbee63d01441d",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Finder\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Finder Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-11-11T19:52:12+00:00"
+ },
{
"name": "symfony/phpunit-bridge",
"version": "v3.4.15",
diff --git a/core/lib/Drupal/Component/Scaffold/composer.json b/core/lib/Drupal/Component/Scaffold/composer.json
index 7b6b4d9417..54b1ce8950 100644
--- a/core/lib/Drupal/Component/Scaffold/composer.json
+++ b/core/lib/Drupal/Component/Scaffold/composer.json
@@ -7,6 +7,9 @@
"php": ">=5.5.9",
"composer-plugin-api": "^1.0.0"
},
+ "require-dev": {
+ "composer/composer": "^1.8"
+ },
"autoload": {
"psr-4": {
"Drupal\\Component\\Scaffold\\": "src/"
diff --git a/core/lib/Drupal/Core/Composer/Composer.php b/core/lib/Drupal/Core/Composer/Composer.php
index d659409a15..d2f352eef8 100644
--- a/core/lib/Drupal/Core/Composer/Composer.php
+++ b/core/lib/Drupal/Core/Composer/Composer.php
@@ -140,14 +140,13 @@ public static function upgradePHPUnitCheck($phpunit_version) {
* from.
*
* @deprecated in Drupal 8.7.0, will be removed before Drupal 9.0.0.
- *
*/
public static function vendorTestCodeCleanup(PackageEvent $event) {
$io = $event->getIO();
- $message = " vendorTestCodeCleanup has been removed. Remove the
- script calls in your project composer.json";
+ // @todo: Add @see for change record.
+ $message = __METHOD__ . '() has been deprecated. Remove the script calls in your project composer.json';
if ($io->isVeryVerbose()) {
- $io->write($message);
+ $io->write('' . $message . '');
}
}
diff --git a/core/tests/Drupal/Tests/Component/Scaffold/PluginTest.php b/core/tests/Drupal/Tests/Component/Scaffold/PluginTest.php
index ee9ed62c83..9b43914bbc 100644
--- a/core/tests/Drupal/Tests/Component/Scaffold/PluginTest.php
+++ b/core/tests/Drupal/Tests/Component/Scaffold/PluginTest.php
@@ -15,25 +15,43 @@
class PluginTest extends TestCase {
/**
+ * Filesystem object.
+ *
* @var \Composer\Util\Filesystem
*/
protected $fs;
/**
+ * Temp directory where we'll exercise the plugin.
+ *
* @var string
*/
protected $tmpDir;
/**
+ * The root directory of the component within the Drupal codebase.
+ *
+ * @var string
+ */
+ protected $componentRootDir;
+
+ /**
+ * The root directory of our Drupal codebase.
+ *
* @var string
*/
- protected $rootDir;
+ protected $drupalRootDir;
/**
* SetUp test.
*/
public function setUp() {
- $this->rootDir = realpath(realpath(__DIR__ . '/Scaffold'));
+ // @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.
+ $this->componentRootDir = $this->drupalRootDir . '/core/lib/Drupal/Component/Scaffold';
// Prepare temp directory.
$this->fs = new Filesystem();
@@ -58,18 +76,20 @@ public function tearDown() {
*/
public function testComposerInstallAndUpdate() {
$exampleScaffoldFile = $this->tmpDir . DIRECTORY_SEPARATOR . 'index.php';
+
$this->assertFileNotExists($exampleScaffoldFile, 'Scaffold file should not be exist.');
$this->composer('install --no-dev --prefer-dist');
$this->assertFileExists($this->tmpDir . DIRECTORY_SEPARATOR . 'core', 'Drupal core is installed.');
$this->assertFileExists($exampleScaffoldFile, 'Scaffold file should be automatically installed.');
+
$this->fs->remove($exampleScaffoldFile);
$this->assertFileNotExists($exampleScaffoldFile, 'Scaffold file should not be exist.');
$this->composer('drupal:scaffold');
$this->assertFileExists($exampleScaffoldFile, 'Scaffold file should be installed by "drupal:scaffold" command.');
- // We touch a scaffold file, so we can check the file was modified after
- // the scaffold update.
- $version = '8.6.x-dev';
+ // We touch a scaffold file, so we can check the file was modified after the
+ // scaffold update.
+ $version = '8.7.x-dev';
touch($exampleScaffoldFile);
$mtime_touched = filemtime($exampleScaffoldFile);
// Requiring a newer version triggers "composer update".
@@ -100,10 +120,10 @@ protected function writeComposerJSON() {
* @return array
*/
protected function composerJSONDefaults() {
- $package = json_decode(file_get_contents($this->rootDir . '/composer.json'), TRUE);
+ $package = json_decode(file_get_contents($this->componentRootDir . '/composer.json'), TRUE);
$package['dist'] = [
'type' => 'path',
- 'url' => $this->rootDir,
+ 'url' => $this->componentRootDir,
];
$package['version'] = '999.0.' . time();
return [
@@ -116,7 +136,7 @@ protected function composerJSONDefaults() {
'require' => [
'composer/installers' => '^1.0.20',
'drupal/drupal-scaffold' => $package['version'],
- 'drupal/core' => '8.5.5',
+ 'drupal/core' => '8.6.0',
],
'minimum-stability' => 'dev',
'prefer-stable' => TRUE,
@@ -131,7 +151,7 @@ protected function composerJSONDefaults() {
*/
protected function composer($command) {
chdir($this->tmpDir);
- passthru(escapeshellcmd($this->rootDir . '/vendor/bin/composer ' . $command), $exit_code);
+ passthru(escapeshellcmd($this->drupalRootDir . '/vendor/bin/composer ' . $command), $exit_code);
if ($exit_code !== 0) {
throw new \Exception('Composer returned a non-zero exit code');
}