PHPackages                             phpunit/example-extension - 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. phpunit/example-extension

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

phpunit/example-extension
=========================

Example of an extension for PHPUnit

3.0.3(8y ago)63861BSD-3-ClausePHPPHP ^7.1

Since Nov 25Pushed 4y ago1 watchersCompare

[ Source](https://github.com/sebastianbergmann/phpunit-example-extension)[ Packagist](https://packagist.org/packages/phpunit/example-extension)[ RSS](/packages/phpunit-example-extension/feed)WikiDiscussions main Synced 2mo ago

READMEChangelogDependencies (1)Versions (10)Used By (0)

PHPUnit Example Extension
=========================

[](#phpunit-example-extension)

Example of an extension for [PHPUnit](https://phpunit.de/).

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

[](#installation)

### Composer

[](#composer)

If you use [Composer](https://getcomposer.org/) to manage the dependencies of your project then you can add the PHPUnit example extension as a development-time dependency to your project:

```
$ composer require --dev phpunit/example-extension

```

### PHP Archive (PHAR)

[](#php-archive-phar)

If you use PHPUnit 5.7 (or later) from a [PHP Archive (PHAR)](https://php.net/phar) then you can download a PHAR of the PHPUnit example extension:

```
$ wget https://phar.phpunit.de/phpunit-example-extension.phar

```

The example below shows how to configure PHPUnit to load all `*.phar` files found in a given directory (`tools/phpunit.d` in this example):

```

```

PHPUnit will only load a an extension PHAR if it provides valid manifest information in a `manifest.xml` file:

```

```

Of course, the extension to be loaded must also be compatible with the version of PHPUnit trying to load it. The extension provides the information required for this compatbility check in its manifest.

When verbose output is activated, PHPUnit will print loaded extension PHARs:

```
$ phpunit --verbose tests
PHPUnit 6.3.0 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.1.8 with Xdebug 2.5.5
Configuration: /home/sb/example/phpunit.xml
Extension:     phpunit/phpunit-example-extension 3.0.0

.                                                                   1 / 1 (100%)

Time: 32 ms, Memory: 4.00MB

OK (1 test, 1 assertion)

```

The `--no-extensions` commandline option can be used to suppress the loading of extensions from the directory configured using `extensionsDirectory`:

```
$ phpunit --no-extensions
PHP Fatal error:  Trait 'PHPUnit\ExampleExtension\TestCaseTrait' not found in ...

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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 ~48 days

Recently: every ~42 days

Total

9

Last Release

3073d ago

Major Versions

1.0.1 → 2.0.02017-04-06

2.0.2 → 3.0.02017-08-13

PHP version history (2 changes)1.0.0PHP ^5.6 || ^7.0

3.0.0PHP ^7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1089?v=4)[Sebastian Probst Eide](/maintainers/sebastian)[@sebastian](https://github.com/sebastian)

---

Top Contributors

[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (24 commits)")

---

Tags

phpunit

### Embed Badge

![Health badge](/badges/phpunit-example-extension/health.svg)

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

###  Alternatives

[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3513.9M32](/packages/jasonmccreary-laravel-test-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M775](/packages/typo3-testing-framework)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)

PHPackages © 2026

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