Issue #2769841 by edgewl2, alexpott, heddn: Prefer caret over tilde in composer.json
parent
a93de775ae
commit
e204c2226b
|
@ -5,10 +5,10 @@
|
||||||
"license": "GPL-2.0+",
|
"license": "GPL-2.0+",
|
||||||
"require": {
|
"require": {
|
||||||
"composer/installers": "^1.0.24",
|
"composer/installers": "^1.0.24",
|
||||||
"wikimedia/composer-merge-plugin": "~1.4"
|
"wikimedia/composer-merge-plugin": "^1.4"
|
||||||
},
|
},
|
||||||
"replace": {
|
"replace": {
|
||||||
"drupal/core": "~8.4"
|
"drupal/core": "^8.4"
|
||||||
},
|
},
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "5264cac45d935c61a1d48a32b71c9f15",
|
"content-hash": "bec46eaaa9fa07a4cbd8c84302f0d275",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "asm89/stack-cors",
|
"name": "asm89/stack-cors",
|
||||||
|
|
|
@ -5,47 +5,47 @@
|
||||||
"license": "GPL-2.0+",
|
"license": "GPL-2.0+",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"symfony/class-loader": "~3.2",
|
"symfony/class-loader": "^3.2",
|
||||||
"symfony/console": "~3.2",
|
"symfony/console": "^3.2",
|
||||||
"symfony/dependency-injection": "~3.2",
|
"symfony/dependency-injection": "^3.2",
|
||||||
"symfony/event-dispatcher": "~3.2",
|
"symfony/event-dispatcher": "^3.2",
|
||||||
"symfony/http-foundation": "~3.2",
|
"symfony/http-foundation": "^3.2",
|
||||||
"symfony/http-kernel": "~3.2",
|
"symfony/http-kernel": "^3.2",
|
||||||
"symfony/routing": "~3.2",
|
"symfony/routing": "^3.2",
|
||||||
"symfony/serializer": "~3.2",
|
"symfony/serializer": "^3.2",
|
||||||
"symfony/translation": "~3.2",
|
"symfony/translation": "^3.2",
|
||||||
"symfony/validator": "~3.2",
|
"symfony/validator": "^3.2",
|
||||||
"symfony/process": "~3.2",
|
"symfony/process": "^3.2",
|
||||||
"symfony/polyfill-iconv": "~1.0",
|
"symfony/polyfill-iconv": "^1.0",
|
||||||
"symfony/yaml": "~3.2",
|
"symfony/yaml": "^3.2",
|
||||||
"twig/twig": "^1.23.1",
|
"twig/twig": "^1.23.1",
|
||||||
"doctrine/common": "^2.5",
|
"doctrine/common": "^2.5",
|
||||||
"doctrine/annotations": "1.2.*",
|
"doctrine/annotations": "^1.2",
|
||||||
"guzzlehttp/guzzle": "^6.2.1",
|
"guzzlehttp/guzzle": "^6.2.1",
|
||||||
"symfony-cmf/routing": "~1.4",
|
"symfony-cmf/routing": "^1.4",
|
||||||
"easyrdf/easyrdf": "0.9.*",
|
"easyrdf/easyrdf": "^0.9",
|
||||||
"zendframework/zend-feed": "~2.4",
|
"zendframework/zend-feed": "^2.4",
|
||||||
"stack/builder": "1.0.*",
|
"stack/builder": "^1.0",
|
||||||
"egulias/email-validator": "1.2.*",
|
"egulias/email-validator": "^1.2",
|
||||||
"masterminds/html5": "~2.1",
|
"masterminds/html5": "^2.1",
|
||||||
"symfony/psr-http-message-bridge": "^1.0",
|
"symfony/psr-http-message-bridge": "^1.0",
|
||||||
"zendframework/zend-diactoros": "~1.1",
|
"zendframework/zend-diactoros": "^1.1",
|
||||||
"composer/semver": "~1.0",
|
"composer/semver": "^1.0",
|
||||||
"paragonie/random_compat": "^1.0|^2.0",
|
"paragonie/random_compat": "^1.0|^2.0",
|
||||||
"asm89/stack-cors": "~1.1"
|
"asm89/stack-cors": "^1.1"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"drush/drush": "<8.1.10"
|
"drush/drush": "<8.1.10"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"behat/mink": "1.7.x-dev",
|
"behat/mink": "1.7.x-dev",
|
||||||
"behat/mink-goutte-driver": "~1.2",
|
"behat/mink-goutte-driver": "^1.2",
|
||||||
"drupal/coder": "8.2.12",
|
"drupal/coder": "^8.2.12",
|
||||||
"jcalderonzumba/gastonjs": "~1.0.2",
|
"jcalderonzumba/gastonjs": "^1.0.2",
|
||||||
"jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
|
"jcalderonzumba/mink-phantomjs-driver": "^0.3.1",
|
||||||
"mikey179/vfsStream": "~1.2",
|
"mikey179/vfsStream": "^1.2",
|
||||||
"phpunit/phpunit": ">=4.8.35 <5",
|
"phpunit/phpunit": ">=4.8.35 <5",
|
||||||
"symfony/css-selector": "~3.2",
|
"symfony/css-selector": "^3.2",
|
||||||
"symfony/phpunit-bridge": "^3.2"
|
"symfony/phpunit-bridge": "^3.2"
|
||||||
},
|
},
|
||||||
"replace": {
|
"replace": {
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"doctrine/common": "2.5.*",
|
"doctrine/common": "2.5.*",
|
||||||
"doctrine/annotations": "1.2.*",
|
"doctrine/annotations": "1.2.*",
|
||||||
"drupal/core-fileCache": "~8.2",
|
"drupal/core-fileCache": "^8.2",
|
||||||
"drupal/core-plugin": "~8.2",
|
"drupal/core-plugin": "^8.2",
|
||||||
"drupal/core-utility": "~8.2"
|
"drupal/core-utility": "^8.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"license": "GPL-2.0+",
|
"license": "GPL-2.0+",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"zendframework/zend-feed": "~2.4"
|
"zendframework/zend-feed": "^2.4"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"license": "GPL-2.0+",
|
"license": "GPL-2.0+",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"drupal/core-utility": "~8.2"
|
"drupal/core-utility": "^8.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"symfony/dependency-injection": "~2.8"
|
"symfony/dependency-injection": "^2.8"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"symfony/expression-language": "For using expressions in service container configuration"
|
"symfony/expression-language": "For using expressions in service container configuration"
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"license": "GPL-2.0+",
|
"license": "GPL-2.0+",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"drupal/utility": "~8.2"
|
"drupal/utility": "^8.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
"license": "GPL-2.0+",
|
"license": "GPL-2.0+",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"drupal/core-filecache": "~8.2",
|
"drupal/core-filecache": "^8.2",
|
||||||
"drupal/core-serialization": "~8.2"
|
"drupal/core-serialization": "^8.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
"license": "GPL-2.0+",
|
"license": "GPL-2.0+",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"symfony/dependency-injection": "~2.8",
|
"symfony/dependency-injection": "^2.8",
|
||||||
"symfony/event-dispatcher": "~2.7"
|
"symfony/event-dispatcher": "^2.7"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"drupal/core-utility": "~8.2"
|
"drupal/core-utility": "^8.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"license": "GPL-2.0+",
|
"license": "GPL-2.0+",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"symfony/http-foundation": "~2.7"
|
"symfony/http-foundation": "^2.7"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"license": "GPL-2.0+",
|
"license": "GPL-2.0+",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"symfony/validator": "~2.7"
|
"symfony/validator": "^2.7"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"license": "GPL-2.0+",
|
"license": "GPL-2.0+",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"drupal/core-utility": "~8.2"
|
"drupal/core-utility": "^8.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"license": "GPL-2.0+",
|
"license": "GPL-2.0+",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"symfony/yaml": "~2.7"
|
"symfony/yaml": "^2.7"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"paragonie/random_compat": "^1.0|^2.0",
|
"paragonie/random_compat": "^1.0|^2.0",
|
||||||
"drupal/core-render": "~8.2"
|
"drupal/core-render": "^8.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.9",
|
"php": ">=5.5.9",
|
||||||
"drupal/core-utility": "~8.2"
|
"drupal/core-utility": "^8.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -88,6 +88,46 @@ class ComposerIntegrationTest extends UnitTestCase {
|
||||||
$this->assertSame($content_hash, $lock['content-hash']);
|
$this->assertSame($content_hash, $lock['content-hash']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests composer.json versions.
|
||||||
|
*
|
||||||
|
* @param string $path
|
||||||
|
* Path to a composer.json to test.
|
||||||
|
*
|
||||||
|
* @dataProvider providerTestComposerJson
|
||||||
|
*/
|
||||||
|
public function testComposerTilde($path) {
|
||||||
|
$content = json_decode(file_get_contents($path), TRUE);
|
||||||
|
$composer_keys = array_intersect(['require', 'require-dev'], array_keys($content));
|
||||||
|
if (empty($composer_keys)) {
|
||||||
|
$this->markTestSkipped("$path has no keys to test");
|
||||||
|
}
|
||||||
|
foreach ($composer_keys as $composer_key) {
|
||||||
|
foreach ($content[$composer_key] as $dependency => $version) {
|
||||||
|
$this->assertFalse(strpos($version, '~'), "Dependency $dependency in $path contains a tilde, use a caret.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data provider for all the composer.json provided by Drupal core.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function providerTestComposerJson() {
|
||||||
|
$root = realpath(__DIR__ . '/../../../../');
|
||||||
|
$tests = [[$root . '/composer.json']];
|
||||||
|
$directory = new \RecursiveDirectoryIterator($root . '/core');
|
||||||
|
$iterator = new \RecursiveIteratorIterator($directory);
|
||||||
|
/** @var \SplFileInfo $file */
|
||||||
|
foreach ($iterator as $file) {
|
||||||
|
if ($file->getFilename() === 'composer.json' && strpos($file->getPath(), 'core/modules/system/tests/fixtures/HtaccessTest') === FALSE) {
|
||||||
|
$tests[] = [$file->getRealPath()];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $tests;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests core's composer.json replace section.
|
* Tests core's composer.json replace section.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue