https://github.com/eliashaeussler/phpunit-attributes
🧙 Additional attributes for tests with PHPUnit
https://github.com/eliashaeussler/phpunit-attributes
attributes php phpunit test testing unit
Last synced: 22 days ago
JSON representation
🧙 Additional attributes for tests with PHPUnit
- Host: GitHub
- URL: https://github.com/eliashaeussler/phpunit-attributes
- Owner: eliashaeussler
- License: gpl-3.0
- Created: 2024-08-18T12:52:33.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-04-10T22:31:30.000Z (23 days ago)
- Last Synced: 2025-04-12T08:05:04.180Z (22 days ago)
- Topics: attributes, php, phpunit, test, testing, unit
- Language: PHP
- Homepage:
- Size: 393 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# PHPUnit Attributes
[](https://coveralls.io/github/eliashaeussler/phpunit-attributes)
[](https://codeclimate.com/github/eliashaeussler/phpunit-attributes/maintainability)
[](https://github.com/eliashaeussler/phpunit-attributes/actions/workflows/cgl.yaml)
[](https://github.com/eliashaeussler/phpunit-attributes/actions/workflows/tests.yaml)
[](https://packagist.org/packages/eliashaeussler/phpunit-attributes)A Composer library with additional attributes to enhance testing with PHPUnit.
## 🔥 Installation
[](https://packagist.org/packages/eliashaeussler/phpunit-attributes)
[](https://packagist.org/packages/eliashaeussler/phpunit-attributes)```bash
composer require --dev eliashaeussler/phpunit-attributes
```## ⚡ Usage
The library ships with a ready-to-use PHPUnit extension. It must be registered
in your PHPUnit configuration file:```diff
+
+
+
tests
src
```Some attributes can be configured with custom extension parameters. These must
be added to the extension registration section like follows:```diff
-
+
+
+
```## 🎢 Attributes
The following attributes are shipped with this library:
### PHP class
* [`#[ForbidsClass]`](docs/attributes/forbids-class.md)
* [`#[RequiresClass]`](docs/attributes/requires-class.md)### PHP constant
* [`#[ForbidsConstant]`](docs/attributes/forbids-constant.md)
* [`#[RequiresConstant]`](docs/attributes/requires-constant.md)### Composer package
* [`#[ForbidsPackage]`](docs/attributes/forbids-package.md)
* [`#[RequiresPackage]`](docs/attributes/requires-package.md)### Environment
* [`#[ForbidsEnv]`](docs/attributes/forbids-env.md)
* [`#[RequiresEnv]`](docs/attributes/requires-env.md)## 🧑💻 Contributing
Please have a look at [`CONTRIBUTING.md`](CONTRIBUTING.md).
## ⭐ License
This project is licensed under [GNU General Public License 3.0 (or later)](LICENSE).