PHPackages                             eliashaeussler/phpunit-attributes - 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. eliashaeussler/phpunit-attributes

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

eliashaeussler/phpunit-attributes
=================================

Provides additional attributes for tests with PHPUnit

2.0.2(2mo ago)472.5k↑94.7%1[1 issues](https://github.com/eliashaeussler/phpunit-attributes/issues)[2 PRs](https://github.com/eliashaeussler/phpunit-attributes/pulls)3GPL-3.0-or-laterPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Aug 24Pushed 1mo ago2 watchersCompare

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

READMEChangelog (10)Dependencies (20)Versions (17)Used By (3)

PHPUnit Attributes
==================

[](#phpunit-attributes)

[![Coverage](https://camo.githubusercontent.com/fda21a70c5d8177753624ef07ccceb37fde01cf88228e16fb2a51641f9a99bc6/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c73436f7665726167652f6769746875622f656c6961736861657573736c65722f706870756e69742d617474726962757465733f6c6f676f3d636f766572616c6c73)](https://coveralls.io/github/eliashaeussler/phpunit-attributes)[![CGL](https://camo.githubusercontent.com/8fecd564d0a43ecd15d2d29a3f8a8163fe2945e27a07bf21441e9a76002489dd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f656c6961736861657573736c65722f706870756e69742d617474726962757465732f63676c2e79616d6c3f6c6162656c3d63676c266c6f676f3d676974687562)](https://github.com/eliashaeussler/phpunit-attributes/actions/workflows/cgl.yaml)[![Tests](https://camo.githubusercontent.com/8d58e3a8df58ad66cd15eb0c42a8c5b1ecb7badb7be86f665659c5dcdc277507/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f656c6961736861657573736c65722f706870756e69742d617474726962757465732f74657374732e79616d6c3f6c6162656c3d7465737473266c6f676f3d676974687562)](https://github.com/eliashaeussler/phpunit-attributes/actions/workflows/tests.yaml)[![Supported PHP Versions](https://camo.githubusercontent.com/a8f8f84b373000e39147c78ec60adc5f1a70e99bd011148ec0870f8dc895fcab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f656c6961736861657573736c65722f706870756e69742d617474726962757465732f7068703f6c6f676f3d706870)](https://packagist.org/packages/eliashaeussler/phpunit-attributes)

A Composer library with additional attributes to enhance testing with PHPUnit.

🔥 Installation
--------------

[](#-installation)

[![Packagist](https://camo.githubusercontent.com/a6a3e11cb6ec5832f814fac03485506874ae7f7bf24c420af0f77f7815097495/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c6961736861657573736c65722f706870756e69742d617474726962757465733f6c6162656c3d76657273696f6e266c6f676f3d7061636b6167697374)](https://packagist.org/packages/eliashaeussler/phpunit-attributes)[![Packagist Downloads](https://camo.githubusercontent.com/46a30caccb03fc7ce3ef9ed7f54dd9b4f2a6e8509436a3a596a97927ee2ab4ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c6961736861657573736c65722f706870756e69742d617474726962757465733f636f6c6f723d627269676874677265656e)](https://packagist.org/packages/eliashaeussler/phpunit-attributes)

```
composer require --dev eliashaeussler/phpunit-attributes
```

⚡ Usage
-------

[](#-usage)

The library ships with a ready-to-use PHPUnit extension. It must be registered in your PHPUnit configuration file:

```

+
+
+

             tests

             src

```

Some attributes can be configured with custom extension parameters. These must be added to the extension registration section like follows:

```

-
+
+
+

```

🎢 Attributes
------------

[](#-attributes)

The following attributes are shipped with this library:

### PHP class

[](#php-class)

- [`#[ForbidsClass]`](docs/attributes/forbids-class.md)
- [`#[RequiresClass]`](docs/attributes/requires-class.md)

### PHP constant

[](#php-constant)

- [`#[ForbidsConstant]`](docs/attributes/forbids-constant.md)
- [`#[RequiresConstant]`](docs/attributes/requires-constant.md)

### Composer package

[](#composer-package)

- [`#[ForbidsPackage]`](docs/attributes/forbids-package.md)
- [`#[RequiresPackage]`](docs/attributes/requires-package.md)

### Environment

[](#environment)

- [`#[ForbidsEnv]`](docs/attributes/forbids-env.md)
- [`#[RequiresEnv]`](docs/attributes/requires-env.md)

🧑‍💻 Contributing
----------------

[](#‍-contributing)

Please have a look at [`CONTRIBUTING.md`](CONTRIBUTING.md).

⭐ License
---------

[](#-license)

This project is licensed under [GNU General Public License 3.0 (or later)](LICENSE).

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance84

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 72.4% 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 ~43 days

Recently: every ~91 days

Total

14

Last Release

72d ago

Major Versions

1.8.0 → 2.0.02025-11-18

PHP version history (4 changes)1.0.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0

1.2.2PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

1.8.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

2.0.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/144cefe55242b883c87cb537463f3ba75a0f8198fc5b602b50c838aae31fe7ee?d=identicon)[eliashaeussler](/maintainers/eliashaeussler)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (257 commits)")[![eliashaeussler](https://avatars.githubusercontent.com/u/16313625?v=4)](https://github.com/eliashaeussler "eliashaeussler (97 commits)")[![jaapio](https://avatars.githubusercontent.com/u/1060433?v=4)](https://github.com/jaapio "jaapio (1 commits)")

---

Tags

attributesphpphpunittesttestingunit

### Embed Badge

![Health badge](/badges/eliashaeussler-phpunit-attributes/health.svg)

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

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