Skip to content

Commit f00ce88

Browse files
committed
Document how to upgrade from v4 to v5
1 parent 149efca commit f00ce88

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

UPGRADE.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
UPGRADE FROM 4.x to 5.0
2+
=======================
3+
4+
This library's v4 core file `JohnKary\PHPUnit\Listener\SpeedTrapListener` has been
5+
replaced by `JohnKary\PHPUnit\Extension\SpeedTrap` in v5. This change reflects
6+
switching from PHPUnit's Listener system to its Hook system.
7+
8+
The `SpeedTrap` Extension must be registered differently in `phpunit.xml`:
9+
10+
```xml
11+
<phpunit bootstrap="vendor/autoload.php">
12+
...
13+
- <listeners>
14+
- <listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener" />
15+
- </listeners>
16+
+ <extensions>
17+
+ <extension class="JohnKary\PHPUnit\Extension\SpeedTrap">
18+
+ <arguments>
19+
+ <array>
20+
+ <element key="slowThreshold">
21+
+ <integer>500</integer>
22+
+ </element>
23+
+ <element key="reportLength">
24+
+ <integer>5</integer>
25+
+ </element>
26+
+ </array>
27+
+ </arguments>
28+
+ </extension>
29+
+ </extensions>
30+
</phpunit>
31+
```
32+
33+
If you have extended the old `JohnKary\PHPUnit\Listener\SpeedTrapListener`, you
34+
must extend the new `JohnKary\PHPUnit\Extension\SpeedTrap`. There are various
35+
method name changes that may affect your custom subclass. See [PR #83](https://github.com/johnkary/phpunit-speedtrap/pull/83)
36+
for how the new class has changed.
37+
138
UPGRADE FROM 3.x to 4.0
239
=======================
340

0 commit comments

Comments
 (0)