Skip to content

Commit

Permalink
Document how to upgrade from v4 to v5
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkary committed Oct 17, 2022
1 parent 149efca commit f00ce88
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
UPGRADE FROM 4.x to 5.0
=======================

This library's v4 core file `JohnKary\PHPUnit\Listener\SpeedTrapListener` has been
replaced by `JohnKary\PHPUnit\Extension\SpeedTrap` in v5. This change reflects
switching from PHPUnit's Listener system to its Hook system.

The `SpeedTrap` Extension must be registered differently in `phpunit.xml`:

```xml
<phpunit bootstrap="vendor/autoload.php">
...
- <listeners>
- <listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener" />
- </listeners>
+ <extensions>
+ <extension class="JohnKary\PHPUnit\Extension\SpeedTrap">
+ <arguments>
+ <array>
+ <element key="slowThreshold">
+ <integer>500</integer>
+ </element>
+ <element key="reportLength">
+ <integer>5</integer>
+ </element>
+ </array>
+ </arguments>
+ </extension>
+ </extensions>
</phpunit>
```

If you have extended the old `JohnKary\PHPUnit\Listener\SpeedTrapListener`, you
must extend the new `JohnKary\PHPUnit\Extension\SpeedTrap`. There are various
method name changes that may affect your custom subclass. See [PR #83](https://github.com/johnkary/phpunit-speedtrap/pull/83)
for how the new class has changed.

UPGRADE FROM 3.x to 4.0
=======================

Expand Down

0 comments on commit f00ce88

Please sign in to comment.