Skip to content

Commit 340af1f

Browse files
committed
Upgrade to composer v2.
1 parent 69e0b36 commit 340af1f

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

composer.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"php": "^7.2"
1414
},
1515
"require-dev": {
16-
"composer/composer": "^1.0",
17-
"phpunit/phpunit": "~8.5.0",
18-
"cakephp/cakephp-codesniffer": "^4.1"
16+
"cakephp/cakephp-codesniffer": "^4.1",
17+
"composer/composer": "^2.0@dev",
18+
"phpunit/phpunit": "~8.5.0"
1919
},
2020
"autoload": {
2121
"psr-4": {
@@ -29,5 +29,10 @@
2929
},
3030
"extra": {
3131
"class": "Cake\\Composer\\Installer\\PluginInstaller"
32-
}
32+
},
33+
"config": {
34+
"sort-packages": true
35+
},
36+
"minimum-stability": "dev",
37+
"prefer-stable": true
3338
}

tests/TestCase/Installer/PluginInstallerTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Composer\Composer;
88
use Composer\Package\Package;
99
use Composer\Repository\RepositoryManager;
10+
use Composer\Util\HttpDownloader;
1011
use PHPUnit\Framework\TestCase;
1112

1213
class PluginInstallerTest extends TestCase
@@ -59,9 +60,13 @@ public function setUp(): void
5960
$composer->setConfig($config);
6061

6162
$this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
63+
64+
$httpDownloader = new HttpDownloader($this->io, $config);
65+
6266
$rm = new RepositoryManager(
6367
$this->io,
64-
$config
68+
$config,
69+
$httpDownloader
6570
);
6671
$composer->setRepositoryManager($rm);
6772

0 commit comments

Comments
 (0)