Skip to content

Commit 319ce79

Browse files
author
Patrick McLain
committed
Update PHPUnit and tests and add PHP 7.2 to composer.json
* Update PHPUnit to version supported by PHP 7.2 * Fix unit tests for updated PHPUnit version
1 parent 130753a commit 319ce79

5 files changed

+13
-24
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
"AFL-3.0"
99
],
1010
"require": {
11-
"php": "~5.5.0|~5.6.0|~7.0.0|~7.1.0",
11+
"php": "~5.5.0|~5.6.0|~7.0.0|~7.1.0|~7.2.0",
1212
"composer/composer": "1.4.1",
1313
"symfony/console": "~2.3, !=2.7.0"
1414
},
1515
"require-dev": {
16-
"phpunit/phpunit": "4.1.0"
16+
"phpunit/phpunit": "~6.2.0"
1717
},
1818
"autoload": {
1919
"psr-4": {

tests/Composer/ConsoleArrayInputFactoryTest.php

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

77
use Magento\Composer\ConsoleArrayInputFactory;
88

9-
class ConsoleArrayInputFactoryTest extends PHPUnit_Framework_TestCase
9+
class ConsoleArrayInputFactoryTest extends \PHPUnit\Framework\TestCase
1010
{
1111

1212
/**
@@ -21,6 +21,6 @@ protected function setUp()
2121

2222
public function testCreate()
2323
{
24-
$this->assertInstanceOf('\Symfony\Component\Console\Input\ArrayInput', $this->factory->create([]));
24+
$this->assertInstanceOf(Symfony\Component\Console\Input\ArrayInput::class, $this->factory->create([]));
2525
}
2626
}

tests/Composer/InfoCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Magento\Composer\MagentoComposerApplication;
88
use Magento\Composer\InfoCommand;
99

10-
class InfoCommandTest extends PHPUnit_Framework_TestCase
10+
class InfoCommandTest extends \PHPUnit\Framework\TestCase
1111
{
1212

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

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

3838
$this->infoCommand = new InfoCommand($this->application);
3939
}

tests/Composer/MagentoComposerApplicationTest.php

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Composer\ConsoleArrayInputFactory;
1010
use Symfony\Component\Console\Output\BufferedOutput;
1111

12-
class MagentoComposerApplicationTest extends PHPUnit_Framework_TestCase
12+
class MagentoComposerApplicationTest extends \PHPUnit\Framework\TestCase
1313
{
1414
/**
1515
* @var MagentoComposerApplication
@@ -33,20 +33,9 @@ class MagentoComposerApplicationTest extends PHPUnit_Framework_TestCase
3333

3434
protected function setUp()
3535
{
36-
$this->composerApplication = $this->getMock(
37-
'Composer\Console\Application',
38-
[
39-
'resetComposer',
40-
'create',
41-
'run'
42-
],
43-
[],
44-
'',
45-
false,
46-
false
47-
);
48-
$this->inputFactory = $this->getMock('Magento\Composer\ConsoleArrayInputFactory', [], [], '', false);
49-
$this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\BufferedOutput', [], [], '', false);
36+
$this->composerApplication = $this->createMock(Composer\Console\Application::class);
37+
$this->inputFactory = $this->createMock(Magento\Composer\ConsoleArrayInputFactory::class);
38+
$this->consoleOutput = $this->createMock(Symfony\Component\Console\Output\BufferedOutput::class);
5039

5140
$this->application = new MagentoComposerApplication(
5241
'path1',

tests/Composer/RequireUpdateDryRunCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Magento\Composer\InfoCommand;
99
use Magento\Composer\RequireUpdateDryRunCommand;
1010

11-
class RequireUpdateDryRunCommandTest extends PHPUnit_Framework_TestCase
11+
class RequireUpdateDryRunCommandTest extends \PHPUnit\Framework\TestCase
1212
{
1313
/**
1414
* @var MagentoComposerApplication|\PHPUnit_Framework_MockObject_MockObject
@@ -64,8 +64,8 @@ class RequireUpdateDryRunCommandTest extends PHPUnit_Framework_TestCase
6464

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

7070
$this->requireUpdateDryRunCommand = new RequireUpdateDryRunCommand(
7171
$this->application,

0 commit comments

Comments
 (0)