Skip to content

Commit 91dae70

Browse files
authored
Merge pull request #18 from enumag/patch-1
Upgrade to PHPUnit 7
2 parents b1fef62 + 6347962 commit 91dae70

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

.travis.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,9 @@ script:
1616

1717
matrix:
1818
include:
19-
- php: 5.6
20-
env: PHPUNIT=~5.7
21-
- php: 7.0
22-
env: PHPUNIT=~5.7
2319
- php: 7.1
24-
env: PHPUNIT=~6
20+
env: PHPUNIT=~7
21+
- php: 7.2
22+
env: PHPUNIT=~7
2523
- php: nightly
26-
env: PHPUNIT=~6
27-
- php: hhvm
28-
dist: trusty
29-
env: PHPUNIT=~5.7
24+
env: PHPUNIT=~7

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=5.6",
15-
"phpunit/phpunit": ">=5.7 <7"
14+
"php": ">=7.1",
15+
"phpunit/phpunit": ">=7.0 <8"
1616
},
1717
"autoload": {
1818
"psr-4": { "MyBuilder\\PhpunitAccelerator\\": "src" }

src/TestListener.php

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

33
namespace MyBuilder\PhpunitAccelerator;
44

5-
use PHPUnit\Framework\BaseTestListener;
5+
use PHPUnit\Framework\TestListener as BaseTestListener;
6+
use PHPUnit\Framework\TestListenerDefaultImplementation;
67

7-
if (!interface_exists('\PHPUnit\Framework\Test')) {
8-
class_alias('\PHPUnit_Framework_Test', '\PHPUnit\Framework\Test');
9-
}
10-
11-
class TestListener extends BaseTestListener
8+
class TestListener implements BaseTestListener
129
{
10+
use TestListenerDefaultImplementation;
11+
1312
private $ignorePolicy;
1413

1514
const PHPUNIT_PROPERTY_PREFIX = 'PHPUnit_';
@@ -19,7 +18,7 @@ public function __construct(IgnoreTestPolicy $ignorePolicy = null)
1918
$this->ignorePolicy = ($ignorePolicy) ?: new NeverIgnoreTestPolicy();
2019
}
2120

22-
public function endTest(\PHPUnit\Framework\Test $test, $time)
21+
public function endTest(\PHPUnit\Framework\Test $test, float $time): void
2322
{
2423
$testReflection = new \ReflectionObject($test);
2524

0 commit comments

Comments
 (0)