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(3mo ago)481.1k↑260.5%1[1 issues](https://github.com/eliashaeussler/phpunit-attributes/issues)[1 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 3d 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 2d ago

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

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

[](#phpunit-attributes)

[![Coverage](https://camo.githubusercontent.com/fda21a70c5d8177753624ef07ccceb37fde01cf88228e16fb2a51641f9a99bc6/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c73436f7665726167652f6769746875622f656c6961736861657573736c65722f706870756e69742d617474726962757465733f6c6f676f3d636f766572616c6c73)](https://coveralls.io/github/eliashaeussler/phpunit-attributes)[![CI](https://camo.githubusercontent.com/d09454c5fb39254c2db834faae4c39abcc7fffacda6e27446dfa83ac3b1b65da/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f656c6961736861657573736c65722f706870756e69742d617474726962757465732f63692e79616d6c3f6c6162656c3d4349266c6f676f3d676974687562)](https://github.com/eliashaeussler/phpunit-attributes/actions/workflows/ci.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

55

—

FairBetter than 97% of packages

Maintenance85

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 73.3% 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

118d 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://avatars.githubusercontent.com/u/16313625?v=4)[Elias Häußler](/maintainers/eliashaeussler)[@eliashaeussler](https://github.com/eliashaeussler)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (307 commits)")[![eliashaeussler](https://avatars.githubusercontent.com/u/16313625?v=4)](https://github.com/eliashaeussler "eliashaeussler (111 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

[brianium/paratest

Parallel testing for PHP

2.5k136.1M985](/packages/brianium-paratest)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M343](/packages/drupal-core-dev)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

30314.4k7](/packages/webmozarts-strict-phpunit)

PHPackages © 2026

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