11# PHPUnit Extra
22
33PHPUnit Extra provides a PHPUnit listener to improve performance of your
4- PHPUnit test suites by cleaning up classes variables at the end of each
4+ PHPUnit test suites by cleaning up classes variables at the end of each
55TestCase. Thanks [ Kris Wallsmith for this tip] ( http://kriswallsmith.net/post/18029585104/faster-phpunit ) .
66
77## Installation
88
9- ### Step 1: Make sure composer knows how to access the library
10-
11- Add the path to the private repository in your ` composer.json ` :
12-
13- ``` json
14- "repositories" : [
15- {
16- "type" : " vcs" ,
17- "url" : " https://github.com/theodo/phpunit-extra"
18- }
19- ]
20- ```
21-
22- ### Step 2: Install the library
9+ ### Step 1: Install the library
2310
2411Open a command console, enter your project directory and execute the
2512following command to download the latest stable version of this bundle:
@@ -32,15 +19,20 @@ This command requires you to have Composer installed globally, as explained
3219in the [ installation chapter] ( https://getcomposer.org/doc/00-intro.md )
3320of the Composer documentation.
3421
35- Github will ask you to create a token and to paste it so that it can
36- download the private Github repository.
22+ ### Step 2: Configure the listener in PHPUnit
3723
38- ### Step 3: Configure the listener in PHPUnit
24+ For PHPUnit >= 7.5, add the extension in your XML config file (e.g. ` phpunit.xml.dist ` ).
25+
26+ ``` xml
27+ <extensions >
28+ <extension class =" \Theodo\PHPUnitExtra\PHPUnit\PHPUnitExtension" />
29+ </extensions >
30+ ```
3931
40- Add a listener in your ` phpunit.xml.dist ` .
32+ For PHPUnit < 7.5 add the listener in your XML config file (e.g. ` phpunit.xml.dist ` ) .
4133
4234``` xml
4335<listeners >
44- <listener class =" \Theodo\PHPUnitExtra\PHPUnitListener \PHPUnitListener" />
36+ <listener class =" \Theodo\PHPUnitExtra\PHPUnit \PHPUnitListener" />
4537</listeners >
4638```
0 commit comments