PHPackages                             zhukovsergei/phpunit-accelerator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. zhukovsergei/phpunit-accelerator

ActiveLibrary[Testing &amp; Quality](/categories/testing)

zhukovsergei/phpunit-accelerator
================================

PHPUnit accelerator

6.0.0(1y ago)010MITPHPPHP &gt;=8.0

Since Aug 6Pushed 1y agoCompare

[ Source](https://github.com/zhukovsergei/phpunit-accelerator)[ Packagist](https://packagist.org/packages/zhukovsergei/phpunit-accelerator)[ RSS](/packages/zhukovsergei-phpunit-accelerator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

PHPUnit Accelerator
===================

[](#phpunit-accelerator)

What I found is that PHPUnit is really hard to debug memory with, because it in itself keeps a lot of objects in memory before actually starting any test so the initial memory is jumping depending by the number of tests available - it creates a new test class instance for each test, so UserTest having 1k test declarations/function will result in 1k UserTest class instances before it actually starts processing them, which I'd say is more of a inefficiency from the PHPUnit side, the more tests you have the higher the starting memory will be.

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
------------

[](#installation)

To install this library, run the command below and you will get the latest version

```
composer require zhukovsergei/phpunit-accelerator --dev
```

Usage
-----

[](#usage)

Just add to your `phpunit.xml` configuration

```

```

### Ignoring Tests

[](#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

```
