PHPackages                             console-helpers/phpunit-compat - 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. console-helpers/phpunit-compat

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

console-helpers/phpunit-compat
==============================

Compatibility layer for PHPUnit test cases/test suite to work on different major PHPUnit versions

v1.0.3(1y ago)03.7k11BSD-3-ClausePHPPHP &gt;=5.6.0

Since Feb 25Pushed 1y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (1)Versions (6)Used By (1)

PHPUnit-Compat
==============

[](#phpunit-compat)

[![CI](https://github.com/console-helpers/phpunit-compat/actions/workflows/tests.yml/badge.svg)](https://github.com/console-helpers/phpunit-compat/actions/workflows/tests.yml)[![codecov](https://camo.githubusercontent.com/84f68b4b07ebf440c920021cd652796a03581e002eae12c86ce086f25d56f9da/68747470733a2f2f636f6465636f762e696f2f67682f636f6e736f6c652d68656c706572732f706870756e69742d636f6d7061742f67726170682f62616467652e7376673f746f6b656e3d4a7065386d4567584c51)](https://codecov.io/gh/console-helpers/phpunit-compat)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/683c55b20dbebdc878a9309fbe6af522d9d2954cf67749606c9a1b781988c941/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f6e736f6c652d68656c706572732f706870756e69742d636f6d7061742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/console-helpers/phpunit-compat/?branch=master)

[![Latest Stable Version](https://camo.githubusercontent.com/af61de4a8172eba051571a5e4ee1f845944af2eb92af7dc7de2af62695581dba/68747470733a2f2f706f7365722e707567782e6f72672f636f6e736f6c652d68656c706572732f706870756e69742d636f6d7061742f762f737461626c65)](https://packagist.org/packages/console-helpers/phpunit-compat)[![Total Downloads](https://camo.githubusercontent.com/2d836b4874be4c56f0a3c7bfe912f7b80eea6be2f950fc0e7de41593606433ea/68747470733a2f2f706f7365722e707567782e6f72672f636f6e736f6c652d68656c706572732f706870756e69742d636f6d7061742f646f776e6c6f616473)](https://packagist.org/packages/console-helpers/phpunit-compat)[![License](https://camo.githubusercontent.com/747461cb046fb0db1b1986757462515179b040627ae7160d9f47043649ff26c9/68747470733a2f2f706f7365722e707567782e6f72672f636f6e736f6c652d68656c706572732f706870756e69742d636f6d7061742f6c6963656e7365)](https://packagist.org/packages/console-helpers/phpunit-compat)

PHPUnit-Compat is a compatibility layer for PHPUnit, that allows creating a test case/test suite classes, that will work across different PHPUnit versions.

### Covered methods:

[](#covered-methods)

- `\PHPUnit\Framework\TestCase:onNotSuccessfulTest` via `\ConsoleHelpers\PHPUnitCompat\AbstractTestCase::onNotSuccessfulTestCompat`;
- `PHPUnit\Framework\TestSuite::run` via `\ConsoleHelpers\PHPUnitCompat\AbstractTestSuite::runCompat`;
- `\PHPUnit\Framework\TestSuite::tearDown` via `\ConsoleHelpers\PHPUnitCompat\AbstractTestSuite::tearDownCompat` (till PHPUnit 8.1.6; in PHPUnit 8.2.0 method was removed).

### Covered classes:

[](#covered-classes)

- `\PHPUnit\Framework\DataProviderTestSuite` via `\ConsoleHelpers\PHPUnitCompat\Framework\DataProviderTestSuite`;
- `\PHPUnit\Framework\TestResult` via `\ConsoleHelpers\PHPUnitCompat\Framework\TestResult`;
- `\PHPUnit\Framework\Test` via `\ConsoleHelpers\PHPUnitCompat\Framework\Test`;
- `\SebastianBergmann\CodeCoverage\CodeCoverage` via `\ConsoleHelpers\CodeCoverageCompat\CodeCoverage`;
- `\SebastianBergmann\CodeCoverage\Driver\Driver'` via `\ConsoleHelpers\CodeCoverageCompat\Driver\Driver`;
- `\SebastianBergmann\CodeCoverage\Filter` via `\ConsoleHelpers\CodeCoverageCompat\Filter`.

For assertion method compatibility please use .

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

[](#installation)

- Execute this command to add as a dependency: `php composer.phar require console-helpers/phpunit-compat`.

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

[](#contributing)

See [CONTRIBUTING](CONTRIBUTING.md) file.

License
-------

[](#license)

PHPUnit-Compat is released under the BSD-3-Clause License. See the bundled [LICENSE](LICENSE) file for details.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~34 days

Total

5

Last Release

676d ago

Major Versions

v0.0.1 → v1.0.02024-03-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/84e70d0bdeaa7cd5875b73c862ccd8359d2df057fb48a716fdd14d99a7f24fca?d=identicon)[aik099](/maintainers/aik099)

---

Top Contributors

[![aik099](https://avatars.githubusercontent.com/u/1277526?v=4)](https://github.com/aik099 "aik099 (26 commits)")

### Embed Badge

![Health badge](/badges/console-helpers-phpunit-compat/health.svg)

```
[![Health](https://phpackages.com/badges/console-helpers-phpunit-compat/health.svg)](https://phpackages.com/packages/console-helpers-phpunit-compat)
```

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