Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpunit Attributes Laravel Package

eliashaeussler/phpunit-attributes

PHPUnit Attributes adds modern PHP 8 attributes to define PHPUnit tests, data providers, groups, dependencies and more in a clean, declarative way. Keep test classes readable and reduce annotation/docblock noise while staying compatible with PHPUnit workflows.

View on GitHub
Deep Wiki
Context7

PHPUnit Attributes

Coverage CI Supported PHP Versions

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

🔥 Installation

Packagist Packagist Downloads

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:

 <?xml version="1.0" encoding="UTF-8"?>
 <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
          bootstrap="vendor/autoload.php"
 >
+    <extensions>
+        <bootstrap class="EliasHaeussler\PHPUnitAttributes\PHPUnitAttributesExtension" />
+    </extensions>
     <testsuites>
         <testsuite name="unit">
             <directory>tests</directory>
         </testsuite>
     </testsuites>
     <source>
         <include>
             <directory>src</directory>
         </include>
     </source>
 </phpunit>

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

     <extensions>
-        <bootstrap class="EliasHaeussler\PHPUnitAttributes\PHPUnitAttributesExtension" />
+        <bootstrap class="EliasHaeussler\PHPUnitAttributes\PHPUnitAttributesExtension">
+            <parameter name="fancyParameterName" value="fancyParameterValue" />
+        </bootstrap>
     </extensions>

🎢 Attributes

The following attributes are shipped with this library:

PHP class

PHP constant

Composer package

Environment

🧑‍💻 Contributing

Please have a look at CONTRIBUTING.md.

⭐ License

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

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
trianity/laravel-vpos
kayiwarahim/relworx
gizburdt/paint
agentisend/agent-email-guard
tobymaxham/laravel-properties
juaniquillo/input-component-action
sunder6218/zipper
veiliglanceren/laravel-webshop-product
lkeio/laraparse
veiliglanceren/laravel-morph-categories
ketapay/ketapay-laravel
cboxdk/laravel-status-client
gzoran/laravel-exception
leafs/sprout
codedor/laravel-livewire-forms
codedor/filament-architect
yangusik/thrun
pushinbr/pam-contracts
9in/php-sdk
yacoubalhaidari/provider-payments-sa