Skip to content

Update PHPUnit and tests and add PHP 7.2 to composer.json #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"name": "magento/composer",
"description": "Magento composer library helps to instantiate Composer application and run composer commands.",
"type": "library",
"version": "1.2.0",
"version": "1.3.0",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0|~7.1.0",
"composer/composer": "1.4.1",
"symfony/console": "~2.3, !=2.7.0"
"php": "~5.5.0|~5.6.0|~7.0.0|~7.1.0|~7.2.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As symfony/console supports PHP ~7.1.3, we should remove older versions from the list of supported here.
Also, need confirmation from @piotrekkaminski that it's ok to support PHP starting from 7.1.3. If not, we should upgrade to symfony 3 only.

"composer/composer": "~1.6.0",
"symfony/console": "~4.0.0"
},
"require-dev": {
"phpunit/phpunit": "4.1.0"
"phpunit/phpunit": "~6.2.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As PHPUnit 7 has been released, can we update to ~7.0.0? Looks like it doesn't cause dependency conflicts and tests pass.

},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions tests/Composer/ConsoleArrayInputFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Magento\Composer\ConsoleArrayInputFactory;

class ConsoleArrayInputFactoryTest extends PHPUnit_Framework_TestCase
class ConsoleArrayInputFactoryTest extends \PHPUnit\Framework\TestCase
{

/**
Expand All @@ -21,6 +21,6 @@ protected function setUp()

public function testCreate()
{
$this->assertInstanceOf('\Symfony\Component\Console\Input\ArrayInput', $this->factory->create([]));
$this->assertInstanceOf(Symfony\Component\Console\Input\ArrayInput::class, $this->factory->create([]));
}
}
4 changes: 2 additions & 2 deletions tests/Composer/InfoCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Magento\Composer\MagentoComposerApplication;
use Magento\Composer\InfoCommand;

class InfoCommandTest extends PHPUnit_Framework_TestCase
class InfoCommandTest extends \PHPUnit\Framework\TestCase
{

private $installedOutput = 'name : 3rdp/a
Expand All @@ -33,7 +33,7 @@ class InfoCommandTest extends PHPUnit_Framework_TestCase

protected function setUp()
{
$this->application = $this->getMock('Magento\Composer\MagentoComposerApplication', [], [], '', false, false);
$this->application = $this->createMock(Magento\Composer\MagentoComposerApplication::class);

$this->infoCommand = new InfoCommand($this->application);
}
Expand Down
19 changes: 4 additions & 15 deletions tests/Composer/MagentoComposerApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Magento\Composer\ConsoleArrayInputFactory;
use Symfony\Component\Console\Output\BufferedOutput;

class MagentoComposerApplicationTest extends PHPUnit_Framework_TestCase
class MagentoComposerApplicationTest extends \PHPUnit\Framework\TestCase
{
/**
* @var MagentoComposerApplication
Expand All @@ -33,20 +33,9 @@ class MagentoComposerApplicationTest extends PHPUnit_Framework_TestCase

protected function setUp()
{
$this->composerApplication = $this->getMock(
'Composer\Console\Application',
[
'resetComposer',
'create',
'run'
],
[],
'',
false,
false
);
$this->inputFactory = $this->getMock('Magento\Composer\ConsoleArrayInputFactory', [], [], '', false);
$this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\BufferedOutput', [], [], '', false);
$this->composerApplication = $this->createMock(Composer\Console\Application::class);
$this->inputFactory = $this->createMock(Magento\Composer\ConsoleArrayInputFactory::class);
$this->consoleOutput = $this->createMock(Symfony\Component\Console\Output\BufferedOutput::class);

$this->application = new MagentoComposerApplication(
'path1',
Expand Down
6 changes: 3 additions & 3 deletions tests/Composer/RequireUpdateDryRunCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Magento\Composer\InfoCommand;
use Magento\Composer\RequireUpdateDryRunCommand;

class RequireUpdateDryRunCommandTest extends PHPUnit_Framework_TestCase
class RequireUpdateDryRunCommandTest extends \PHPUnit\Framework\TestCase
{
/**
* @var MagentoComposerApplication|\PHPUnit_Framework_MockObject_MockObject
Expand Down Expand Up @@ -64,8 +64,8 @@ class RequireUpdateDryRunCommandTest extends PHPUnit_Framework_TestCase

protected function setUp()
{
$this->application = $this->getMock('Magento\Composer\MagentoComposerApplication', [], [], '', false, false);
$this->infoCommand = $this->getMock('Magento\Composer\InfoCommand', [], [], '', false, false);
$this->application = $this->createMock(Magento\Composer\MagentoComposerApplication::class);
$this->infoCommand = $this->createMock(Magento\Composer\InfoCommand::class);

$this->requireUpdateDryRunCommand = new RequireUpdateDryRunCommand(
$this->application,
Expand Down