Skip to content

Commit bf42ebf

Browse files
authored
Merge pull request #41 from luispabon/phpunit7
Make compatible with phpunit 7.x
2 parents a1e39e0 + 10c3a35 commit bf42ebf

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ language: php
33
sudo: false
44

55
php:
6-
- 7.0
76
- 7.1
7+
- 7.2
88
- nightly
99

1010
env:
11-
- PHPUNIT=6.0.*
11+
- PHPUNIT=7.*
1212

1313
cache:
1414
directories:

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">=7.0",
16-
"phpunit/phpunit": "^6.0"
15+
"php": ">=7.1",
16+
"phpunit/phpunit": "^7.0"
1717
},
1818
"autoload": {
1919
"psr-4": {
@@ -27,7 +27,7 @@
2727
},
2828
"extra": {
2929
"branch-alias": {
30-
"dev-master": "2.0-dev"
30+
"dev-master": "3.0-dev"
3131
}
3232
}
3333
}

src/SpeedTrapListener.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33

44
namespace JohnKary\PHPUnit\Listener;
55

6-
use PHPUnit\Framework\{AssertionFailedError, TestSuite, Test, TestCase, BaseTestListener, Warning};
6+
use PHPUnit\Framework\{TestListener, TestListenerDefaultImplementation, TestSuite, Test, TestCase};
77

88
/**
99
* A PHPUnit TestListener that exposes your slowest running tests by outputting
1010
* results directly to the console.
1111
*/
12-
class SpeedTrapListener extends BaseTestListener
12+
class SpeedTrapListener implements TestListener
1313
{
14+
use TestListenerDefaultImplementation;
15+
1416
/**
1517
* Internal tracking for test suites.
1618
*
@@ -52,7 +54,7 @@ public function __construct(array $options = [])
5254
* @param Test $test
5355
* @param float $time
5456
*/
55-
public function endTest(Test $test, $time)
57+
public function endTest(Test $test, float $time): void
5658
{
5759
if (!$test instanceof TestCase) return;
5860

@@ -69,7 +71,7 @@ public function endTest(Test $test, $time)
6971
*
7072
* @param TestSuite $suite
7173
*/
72-
public function startTestSuite(TestSuite $suite)
74+
public function startTestSuite(TestSuite $suite): void
7375
{
7476
$this->suites++;
7577
}
@@ -79,7 +81,7 @@ public function startTestSuite(TestSuite $suite)
7981
*
8082
* @param TestSuite $suite
8183
*/
82-
public function endTestSuite(TestSuite $suite)
84+
public function endTestSuite(TestSuite $suite): void
8385
{
8486
$this->suites--;
8587

0 commit comments

Comments
 (0)