Skip to content

Commit

Permalink
Merge pull request #2 from magento-trigger/MC-41087
Browse files Browse the repository at this point in the history
MC-41087: Add Composer 2 support to magento/composer
  • Loading branch information
fascinosum authored Feb 26, 2021
2 parents fcc66f5 + 3bd4b31 commit 91e0424
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
atlassian*
/.idea
/.gitattributes
/composer.lock
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "magento/composer",
"description": "Magento composer library helps to instantiate Composer application and run composer commands.",
"type": "library",
"version": "1.6.0",
"version": "1.7.0-beta1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"php": "~7.3.0||~7.4.0",
"composer/composer": "^1.9",
"composer/composer": "^1.9 || ^2.0",
"symfony/console": "~4.4.0"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.1/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
Expand Down
2 changes: 1 addition & 1 deletion src/RequireUpdateDryRunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function run($packages, $workingDir = null)
/**
* Generates additional explanation for error message
*
* @param array $message
* @param string $message
* @param array $inputPackages
* @return string
*/
Expand Down
3 changes: 2 additions & 1 deletion tests/Composer/InfoCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Magento\Composer\MagentoComposerApplication;
use Magento\Composer\InfoCommand;
use PHPUnit\Framework\MockObject\MockObject;

class InfoCommandTest extends \PHPUnit\Framework\TestCase
{
Expand All @@ -22,7 +23,7 @@ class InfoCommandTest extends \PHPUnit\Framework\TestCase
3rdp/c 1.1.0';

/**
* @var MagentoComposerApplication|\PHPUnit_Framework_MockObject_MockObject
* @var MagentoComposerApplication|MockObject
*/
protected $application;

Expand Down
7 changes: 4 additions & 3 deletions tests/Composer/MagentoComposerApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Composer\Console\Application;
use Magento\Composer\MagentoComposerApplication;
use Magento\Composer\ConsoleArrayInputFactory;
use PHPUnit\Framework\MockObject\MockObject;
use Symfony\Component\Console\Output\BufferedOutput;

class MagentoComposerApplicationTest extends \PHPUnit\Framework\TestCase
Expand All @@ -17,17 +18,17 @@ class MagentoComposerApplicationTest extends \PHPUnit\Framework\TestCase
protected $application;

/**
* @var Application|\PHPUnit_Framework_MockObject_MockObject
* @var Application|MockObject
*/
protected $composerApplication;

/**
* @var ConsoleArrayInputFactory|\PHPUnit_Framework_MockObject_MockObject
* @var ConsoleArrayInputFactory|MockObject
*/
protected $inputFactory;

/**
* @var BufferedOutput|\PHPUnit_Framework_MockObject_MockObject
* @var BufferedOutput|MockObject
*/
protected $consoleOutput;

Expand Down
7 changes: 4 additions & 3 deletions tests/Composer/RequireUpdateDryRunCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
use Magento\Composer\MagentoComposerApplication;
use Magento\Composer\InfoCommand;
use Magento\Composer\RequireUpdateDryRunCommand;
use PHPUnit\Framework\MockObject\MockObject;

class RequireUpdateDryRunCommandTest extends \PHPUnit\Framework\TestCase
{
/**
* @var MagentoComposerApplication|\PHPUnit_Framework_MockObject_MockObject
* @var MagentoComposerApplication|MockObject
*/
protected $application;

/**
* @var InfoCommand|\PHPUnit_Framework_MockObject_MockObject
* @var InfoCommand|MockObject
*/
protected $infoCommand;

Expand Down Expand Up @@ -81,7 +82,7 @@ public function testRun()

public function testRunException()
{
$this->application->expects($this->at(1))
$this->application->expects($this->once())
->method('runComposerCommand')
->willThrowException(new \RuntimeException($this->errorMessage));
$this->expectException(\RuntimeException::class);
Expand Down

0 comments on commit 91e0424

Please sign in to comment.