Skip to content

Commit 8ef3d15

Browse files
minor #832 Allow Symfony 6 (nicolas-grekas)
This PR was merged into the 1.17-dev branch. Discussion ---------- Allow Symfony 6 Commits ------- da832e8 Allow Symfony 6
2 parents 0170279 + da832e8 commit 8ef3d15

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
"minimum-stability": "dev",
1313
"require": {
1414
"php": ">=7.1",
15-
"composer-plugin-api": "^1.0|^2.0"
15+
"composer-plugin-api": ">=1.0"
1616
},
1717
"require-dev": {
1818
"composer/composer": "^1.0.2|^2.0",
19-
"symfony/dotenv": "^4.4|^5.0",
20-
"symfony/filesystem": "^4.4|^5.0",
21-
"symfony/phpunit-bridge": "^4.4.12|^5.0",
22-
"symfony/process": "^3.4|^4.4|^5.0"
19+
"symfony/dotenv": "^4.4|^5.0|^6.0",
20+
"symfony/filesystem": "^4.4|^5.0|^6.0",
21+
"symfony/phpunit-bridge": "^4.4.12|^5.0|^6.0",
22+
"symfony/process": "^4.4|^5.0|^6.0"
2323
},
2424
"autoload": {
2525
"psr-4": {

tests/UnpackerTest.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public function testDoNotDuplicateEntry(): void
4040
file_put_contents($composerJsonPath, '{}');
4141

4242
$originalEnvComposer = getenv('COMPOSER');
43+
$originalEnvComposer = $_SERVER['COMPOSER'];
44+
$_SERVER['COMPOSER'] = $composerJsonPath;
45+
// composer 2.1 and lower support
4346
putenv('COMPOSER='.$composerJsonPath);
4447

4548
// Setup packages
@@ -49,11 +52,11 @@ public function testDoNotDuplicateEntry(): void
4952

5053
$virtualPkgFoo = new Package('pack_foo', '1.0.0', '1.0.0');
5154
$virtualPkgFoo->setType('symfony-pack');
52-
$virtualPkgFoo->setRequires([$realPkgLink]);
55+
$virtualPkgFoo->setRequires(['real' => $realPkgLink]);
5356

5457
$virtualPkgBar = new Package('pack_bar', '1.0.0', '1.0.0');
5558
$virtualPkgBar->setType('symfony-pack');
56-
$virtualPkgBar->setRequires([$realPkgLink]);
59+
$virtualPkgBar->setRequires(['real' => $realPkgLink]);
5760

5861
$packages = [$realPkg, $virtualPkgFoo, $virtualPkgBar];
5962

@@ -87,6 +90,12 @@ public function testDoNotDuplicateEntry(): void
8790

8891
// Restore
8992

93+
if ($originalEnvComposer) {
94+
$_SERVER['COMPOSER'] = $originalEnvComposer;
95+
} else {
96+
unset($_SERVER['COMPOSER']);
97+
}
98+
// composer 2.1 and lower support
9099
putenv('COMPOSER='.$originalEnvComposer);
91100
@unlink($composerJsonPath);
92101
}

0 commit comments

Comments
 (0)