Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mybuilder/phpunit-accelerator
Listeners to speed up PHPUnit tests
https://github.com/mybuilder/phpunit-accelerator
php phpunit
Last synced: 1 day 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 (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-06-08T13:33:42.000Z (over 6 years ago)
- Last Synced: 2024-12-14T21:08:01.027Z (9 days ago)
- Topics: php, phpunit
- Language: PHP
- Size: 25.4 KB
- Stars: 135
- Watchers: 20
- Forks: 12
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHPUnit Accelerator
[![Build Status](https://secure.travis-ci.org/mybuilder/phpunit-accelerator.svg?branch=master)](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.