PHPackages                             lloople/phpunit-extensions - 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. lloople/phpunit-extensions

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

lloople/phpunit-extensions
==========================

📦 Some cool extensions for PHPUnit

v2.1.0(2y ago)38181.3k↓31.3%7[1 issues](https://github.com/Lloople/phpunit-extensions/issues)MITPHPPHP ^7.1|^8CI failing

Since Jan 4Pushed 2y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

PHPUnit Extensions
==================

[](#phpunit-extensions)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5d1df6bb13ef45a6070d8de5ddf36dd1d807c74a5e967238cce1693154913374/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6c6f6f706c652f706870756e69742d657874656e73696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lloople/phpunit-extensions)[![Build Status](https://camo.githubusercontent.com/bd7220f2d623be48361b58326e47abac485546a57f56b407ce4d2b759b673b07/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c6c6f6f706c652f706870756e69742d657874656e73696f6e732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/lloople/phpunit-extensions)[![Quality Score](https://camo.githubusercontent.com/8d5ad9b735b9c4374411260dbf6fd34a7ab4ecad6e896a2abfa2bb77f160d6bd/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c6c6f6f706c652f706870756e69742d657874656e73696f6e732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/lloople/phpunit-extensions)[![Total Downloads](https://camo.githubusercontent.com/c76fff09ffa3cf1672ab9e79cf56291db76913e25c6acd25862469460085f7b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6c6f6f706c652f706870756e69742d657874656e73696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lloople/phpunit-extensions)[![Buy us a tree](https://camo.githubusercontent.com/e6a994e408cb92b84326b68ee88e99e87f54edfe9f26c6b97c4babdeec8298fa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4275792532304a616d657325323061253230747265652d2546302539462538432542332d6c69676874677265656e)](https://plant.treeware.earth/Lloople/phpunit-extensions)

This package provides you a few useful extensions for your testsuite in an effort to improve your code.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require lloople/phpunit-extensions --dev
```

Add the Extension to your `phpunit.xml` file:

```

```

Extensions
----------

[](#extensions)

### Console

[](#console)

Output the slowest tests on the console.

```

```

```
Showing the top 5 slowest tests:
  543 ms: Tests\Feature\ProfileTest::can_upload_new_profile_image
   26 ms: Tests\Feature\ProfileTest::can_visit_profile_page
   25 ms: Tests\Feature\ProfileTest::throws_validation_error_if_password_not_match

```

Default options are:

- rows: `5` (Report 5 tests max)
- min: `200` (Report tests slower than 200ms)

### Csv

[](#csv)

Write the tests in a CSV file ready for import.

```

```

Default options are:

- file: `phpunit_results.csv`
- rows: `null` (all the tests)
- min: `200`

### Json

[](#json)

Write the tests in a JSON file ready for import.

```

```

Default options are:

- file: `phpunit_results.json`
- rows: `null` (all the tests)
- min: `200`

### MySQL

[](#mysql)

Store the test name and the time into a MySQL database. It will override existing records

```

```

Default credentials are (as array):

- database: `phpunit_results`
- table: `default`
- username: `root`
- password: ``
- host: `127.0.0.1`
- rows: `null` (all the tests)
- min: `200`

### SQLite

[](#sqlite)

Store the test name and the time into a SQLite database. It will override existing records

```

```

Default credentials are (as array):

- database: `phpunit_results.db`
- table: `default`
- rows: `null` (all the tests)
- min: `200`

Arguments
---------

[](#arguments)

To override the default configuration per extension, you need to use ``in your `phpunit.xml` file

```

    phpunit_results_as_json.json
    10
    400

```

In the case of the MySQL and SQLite, which needs a database connection, configuration goes as array

```

        my_phpunit_results

        project1_test_results

        homestead

        secret

        192.168.12.14

```

You don't need to override those credentials that already fit to your usecase, since the class will merge your configuration with the default one

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [David Llop](https://github.com/lloople)
- [All Contributors](../../contributors)

Treeware
--------

[](#treeware)

You're free to use this package, but if it is really useful for you I would highly appreciate you [buying the world a tree](https://plant.treeware.earth/Lloople/phpunit-extensions).

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you contribute to [Treeware](https://plant.treeware.earth/Lloople/phpunit-extensions)'s forest you’ll be creating employment for local families and restoring wildlife habitats.

You can buy trees here [offset.earth/treeware](https://plant.treeware.earth/Lloople/phpunit-extensions)

Read more about Treeware at [treeware.earth](http://treeware.earth)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~448 days

Total

4

Last Release

979d ago

Major Versions

v1.1.0 → v2.0.02020-01-08

PHP version history (2 changes)v1.0.0PHP ^7.1

v2.1.0PHP ^7.1|^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/777a92668f51536d86a9fed19c92180d626b46f134b002c3a068e92d295c7541?d=identicon)[lloople](/maintainers/lloople)

---

Top Contributors

[![Lloople](https://avatars.githubusercontent.com/u/5665466?v=4)](https://github.com/Lloople "Lloople (21 commits)")[![jamesmills](https://avatars.githubusercontent.com/u/557096?v=4)](https://github.com/jamesmills "jamesmills (1 commits)")[![lezhnev74](https://avatars.githubusercontent.com/u/10206110?v=4)](https://github.com/lezhnev74 "lezhnev74 (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

csvdatabaselogphpphp-packagephpunitphpunit-extensionsphpunit-packagetestingllooplephpunit-extensions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lloople-phpunit-extensions/health.svg)

```
[![Health](https://phpackages.com/badges/lloople-phpunit-extensions/health.svg)](https://phpackages.com/packages/lloople-phpunit-extensions)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
