Skip to content

Commit 91e0424

Browse files
authored
Merge pull request #2 from magento-trigger/MC-41087
MC-41087: Add Composer 2 support to magento/composer
2 parents fcc66f5 + 3bd4b31 commit 91e0424

File tree

7 files changed

+15
-11
lines changed

7 files changed

+15
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
atlassian*
77
/.idea
88
/.gitattributes
9+
/composer.lock

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"name": "magento/composer",
33
"description": "Magento composer library helps to instantiate Composer application and run composer commands.",
44
"type": "library",
5-
"version": "1.6.0",
5+
"version": "1.7.0-beta1",
66
"license": [
77
"OSL-3.0",
88
"AFL-3.0"
99
],
1010
"require": {
1111
"php": "~7.3.0||~7.4.0",
12-
"composer/composer": "^1.9",
12+
"composer/composer": "^1.9 || ^2.0",
1313
"symfony/console": "~4.4.0"
1414
},
1515
"require-dev": {

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.1/phpunit.xsd"
55
backupGlobals="false"
66
colors="true"
77
bootstrap="vendor/autoload.php"

src/RequireUpdateDryRunCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function run($packages, $workingDir = null)
7272
/**
7373
* Generates additional explanation for error message
7474
*
75-
* @param array $message
75+
* @param string $message
7676
* @param array $inputPackages
7777
* @return string
7878
*/

tests/Composer/InfoCommandTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Magento\Composer\MagentoComposerApplication;
88
use Magento\Composer\InfoCommand;
9+
use PHPUnit\Framework\MockObject\MockObject;
910

1011
class InfoCommandTest extends \PHPUnit\Framework\TestCase
1112
{
@@ -22,7 +23,7 @@ class InfoCommandTest extends \PHPUnit\Framework\TestCase
2223
3rdp/c 1.1.0';
2324

2425
/**
25-
* @var MagentoComposerApplication|\PHPUnit_Framework_MockObject_MockObject
26+
* @var MagentoComposerApplication|MockObject
2627
*/
2728
protected $application;
2829

tests/Composer/MagentoComposerApplicationTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Composer\Console\Application;
88
use Magento\Composer\MagentoComposerApplication;
99
use Magento\Composer\ConsoleArrayInputFactory;
10+
use PHPUnit\Framework\MockObject\MockObject;
1011
use Symfony\Component\Console\Output\BufferedOutput;
1112

1213
class MagentoComposerApplicationTest extends \PHPUnit\Framework\TestCase
@@ -17,17 +18,17 @@ class MagentoComposerApplicationTest extends \PHPUnit\Framework\TestCase
1718
protected $application;
1819

1920
/**
20-
* @var Application|\PHPUnit_Framework_MockObject_MockObject
21+
* @var Application|MockObject
2122
*/
2223
protected $composerApplication;
2324

2425
/**
25-
* @var ConsoleArrayInputFactory|\PHPUnit_Framework_MockObject_MockObject
26+
* @var ConsoleArrayInputFactory|MockObject
2627
*/
2728
protected $inputFactory;
2829

2930
/**
30-
* @var BufferedOutput|\PHPUnit_Framework_MockObject_MockObject
31+
* @var BufferedOutput|MockObject
3132
*/
3233
protected $consoleOutput;
3334

tests/Composer/RequireUpdateDryRunCommandTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
use Magento\Composer\MagentoComposerApplication;
88
use Magento\Composer\InfoCommand;
99
use Magento\Composer\RequireUpdateDryRunCommand;
10+
use PHPUnit\Framework\MockObject\MockObject;
1011

1112
class RequireUpdateDryRunCommandTest extends \PHPUnit\Framework\TestCase
1213
{
1314
/**
14-
* @var MagentoComposerApplication|\PHPUnit_Framework_MockObject_MockObject
15+
* @var MagentoComposerApplication|MockObject
1516
*/
1617
protected $application;
1718

1819
/**
19-
* @var InfoCommand|\PHPUnit_Framework_MockObject_MockObject
20+
* @var InfoCommand|MockObject
2021
*/
2122
protected $infoCommand;
2223

@@ -81,7 +82,7 @@ public function testRun()
8182

8283
public function testRunException()
8384
{
84-
$this->application->expects($this->at(1))
85+
$this->application->expects($this->once())
8586
->method('runComposerCommand')
8687
->willThrowException(new \RuntimeException($this->errorMessage));
8788
$this->expectException(\RuntimeException::class);

0 commit comments

Comments
 (0)