Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91fab42

Browse files
committed
Drop PHP 5.6 to support PHP 7.4
... testing both versions in PHPUnit is not possible.
1 parent e0f5bd7 commit 91fab42

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: php
22
dist: trusty
33
php:
4-
- "5.6"
54
- "7.2"
65
- "7.3"
76
- "7.4"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"require-dev": {
2727
"composer/composer": "^2.0",
28-
"phpunit/phpunit": "4.*",
28+
"phpunit/phpunit": "^8.5.9",
2929
"derhasi/tempdirectory": "0.1.*",
3030
"squizlabs/php_codesniffer": "2.*",
3131
"escapestudios/symfony2-coding-standard": "2.*"

tests/FixturesTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
namespace DrupalComposer\PreservePaths\Tests;
44

55
use derhasi\tempdirectory\TempDirectory;
6+
use PHPUnit\Framework\TestCase;
67

78
/**
89
* Tests for some examples.
910
*/
10-
class FixturesTest extends \PHPUnit_Framework_TestCase
11+
class FixturesTest extends TestCase
1112
{
1213

1314
/**
@@ -28,7 +29,7 @@ class FixturesTest extends \PHPUnit_Framework_TestCase
2829
/**
2930
* Set up test.
3031
*/
31-
protected function setUp()
32+
protected function setUp(): void
3233
{
3334
$this->projectRoot = realpath(__DIR__.'/..');
3435
$this->composerBin = realpath(__DIR__.'/../vendor/bin/composer');
@@ -57,7 +58,7 @@ public function testFixtures($folder, $commands = array(), $files = array())
5758
// Add this project as local development repository sow we work with
5859
// the latest code.
5960
$this->composer('config', 'repositories.dev', 'path', $this->projectRoot);
60-
61+
6162
$output = $this->composer('install');
6263

6364
// Check for deprecation notices.
@@ -67,12 +68,12 @@ public function testFixtures($folder, $commands = array(), $files = array())
6768
foreach ($commands as $command) {
6869
call_user_func_array(array($this, 'composer'), $command);
6970
}
70-
71+
7172
// Check for file existance.
7273
foreach ($files as $file) {
7374
$this->assertFileExists($file);
7475
}
75-
76+
7677
unset($workingDirectory);
7778
}
7879

@@ -94,7 +95,7 @@ public function fixturesProvider()
9495
),
9596
);
9697
}
97-
98+
9899
/**
99100
* Run composer command.
100101
*
@@ -134,7 +135,7 @@ protected function composer($command)
134135
protected function assertDeprecationNotice($lines)
135136
{
136137
foreach ($lines as $line) {
137-
$this->assertNotContains('Deprecation Notice:', $line);
138+
$this->assertStringNotContainsString('Deprecation Notice:', $line);
138139
}
139140
}
140141
}

tests/PathPreserverTest.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,35 @@
22

33
namespace DrupalComposer\PreservePaths\Tests;
44

5-
use DrupalComposer\PreservePaths\PathPreserver;
5+
use Composer\IO\IOInterface;
66
use Composer\Util\Filesystem;
7-
use Composer\Package\Package;
8-
use Composer\Package\RootPackage;
9-
use Composer\Composer;
10-
use Composer\Config;
117
use derhasi\tempdirectory\TempDirectory;
8+
use DrupalComposer\PreservePaths\PathPreserver;
9+
use PHPUnit\Framework\TestCase;
1210

1311
/**
1412
* Test for path preserver functionality.
1513
*/
16-
class PathPreserverTest extends \PHPUnit_Framework_TestCase
14+
class PathPreserverTest extends TestCase
1715
{
1816

17+
/**
18+
* @var \Composer\Util\Filesystem
19+
*/
20+
protected $fs;
21+
22+
/**
23+
* @var \Composer\IO\IOInterface
24+
*/
25+
protected $io;
26+
1927
/**
2028
* set up test environmemt
2129
*/
22-
public function setUp()
30+
protected function setUp(): void
2331
{
2432
$this->fs = new Filesystem();
25-
$this->io = $this->getMock('Composer\IO\IOInterface');
33+
$this->io = $this->getMockBuilder(IOInterface::class)->getMock();
2634
}
2735

2836
/**

0 commit comments

Comments
 (0)