https://github.com/mybuilder/phpunit-accelerator
Listeners to speed up PHPUnit tests
https://github.com/mybuilder/phpunit-accelerator
php phpunit
Last synced: about 1 month ago
JSON representation
Listeners to speed up PHPUnit tests
- Host: GitHub
- URL: https://github.com/mybuilder/phpunit-accelerator
- Owner: mybuilder
- License: mit
- Created: 2014-03-13T12:23:23.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-06-08T13:33:42.000Z (almost 7 years ago)
- Last Synced: 2025-03-29T05:10:04.929Z (about 2 months ago)
- Topics: php, phpunit
- Language: PHP
- Size: 25.4 KB
- Stars: 136
- Watchers: 19
- Forks: 12
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHPUnit Accelerator
[](http://travis-ci.org/mybuilder/phpunit-accelerator)
Inspired by [Kris Wallsmith faster PHPUnit article](http://kriswallsmith.net/post/18029585104/faster-phpunit), we've created a [PHPUnit](http://phpunit.de) test listener that speeds up PHPUnit tests about 20% by freeing memory.
## Installation
To install this library, run the command below and you will get the latest version
``` bash
composer require mybuilder/phpunit-accelerator --dev
```## Usage
Just add to your `phpunit.xml` configuration
```xml
```
### Ignoring Tests
Sometimes it is necessary to ignore specific tests, where freeing their properties is undesired. For this use case, you have the ability to *extend the behaviour* of the listener by implementing the `IgnoreTestPolicy` interface.
As an example, if we hypothetically wanted to ignore all tests which include "Legacy" in their test filename, we could create a custom ignore policy as follows
```php
getFilename(), 'Legacy') !== false;
}
}
```And pass it to the constructor of our test listener in `phpunit.xml` configuration
```xml
```
---
Created by [MyBuilder](http://www.mybuilder.com/) - Check out our [blog](http://tech.mybuilder.com/) for more insight into this and other open-source projects we release.