Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.