pestphp/pest-plugin
Plugin API for Pest PHP, the elegant testing framework. Use it to build and distribute Pest plugins that extend the runner, add custom expectations, hooks, and tooling integrations for your PHP test suite.
This package (pestphp/pest-plugin) provides the internal API for extending Pest (e.g., building plugins like pest-plugin-laravel, pest-plugin-artisan, etc.). It is not meant for direct end-user usage — instead, it powers official and community plugins.
require-dev dependency in your plugin project (e.g., composer require pestphp/pest-plugin --dev), then consult its src/ structure — key interfaces include Plugin, PluginServiceProvider, and PluginContract.Pest\Plugin\Plugin and register your plugin via Pest\Plugins\register(YourPlugin::class) in your package’s ServiceProvider (often PestServiceProvider).addMacro() or beforeEach() hooks inside your plugin to augment global test behavior (e.g., Pest::macro('actingAsUser', fn() => $this->actingAs(User::factory()->create()))).Plugin::beforeEach(), afterEach(), beforeAll(), afterAll() to inject setup/cleanup logic globally or per group.pestphp/pest, not this package directly — the plugin API is bundled and exposed as part of pestphp/pest in production.Plugin classes into your tests/Pest.php) can break compatibility.pest-plugin-laravel v2.x only works with Pest v2.x). Pin versions rigorously../vendor/bin/pest --init to reinitialize Pest’s config.Pest\Plugins\loaded() to list registered plugins (great for development).expect()->extend('toBeEven', fn() => $this->value % 2 === 0).Plugin::extendConsoleOutput() (if available in your version).pestphp/pest-plugin-laravel, pestphp/pest-plugin-livewire) as de facto examples.How can I help you explore Laravel packages today?