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
Pest Plugin Global Assertions

Pest Plugin Global Assertions Laravel Package

pestphp/pest-plugin-global-assertions

A Pest plugin that adds global assertion helpers like assertTrue(), assertEquals(), and assertSame() to your test suite, bringing familiar PHPUnit-style assertion functions to Pest tests without extra imports or setup.

View on GitHub
Deep Wiki
Context7

A plugin to add global assertions to Pest

Frequently asked questions about Pest Plugin Global Assertions
What does pestphp/pest-plugin-global-assertions do?
It is a dev-only Pest plugin that adds global assertion helpers such as assertTrue(), assertEquals(), and assertSame() to your test suite. It brings familiar PHPUnit-style assertion functions into Pest tests without extra imports or setup. Its footprint is limited to the test layer, with no service provider, published config, or runtime code.
How do I install pest-plugin-global-assertions in a Laravel project?
Install it as a Composer dev dependency with composer require --dev pestphp/pest-plugin-global-assertions. The plugin is auto-discovered through extra.pest.plugins, so no service provider registration is required. You can then use the global assertion helpers directly in your Pest tests.
Which Pest, PHPUnit, and PHP versions does pest-plugin-global-assertions support?
There is no visible CI compatibility matrix in the available assessment, so explicit Pest, PHPUnit, and PHP version support is not confirmed. Before making it load-bearing, spike it against your exact Pest major, PHPUnit major, and PHP version. Also check behaviour across upgrades to catch silent behavioural drift.
Do I need a service provider or published config for this plugin?
No. The plugin has no service provider, no published configuration, and no runtime wiring. It is a test-layer package intended for require-dev only. That makes adoption and removal cheap compared with production dependencies.
Does pest-plugin-global-assertions work with pest --parallel and RefreshDatabase?
Parallel testing and Laravel lifecycle interaction are specific hazards to validate rather than assume. The plugin relies on global registration, which can be sensitive to load order and global state, especially in a monorepo with multiple Pest.php files. Run a spike under pest --parallel and with RefreshDatabase before depending on it broadly.
Can global assertions collide with Pest core expectations or other plugins?
There is no visible namespacing story, so name collisions in the global expectation namespace are a real risk. Use clear naming conventions, assign an owner, and enforce review discipline for any shared global assertions. Prefixing custom assertions can reduce clashes with core expectations and other plugins.
How is this different from expect()->extend() in tests/Pest.php?
The plugin gives you global PHPUnit-style functions like assertTrue(), assertEquals(), and assertSame() without imports. expect()->extend() plus a shared bootstrap file can also define reusable custom expectations in tests/Pest.php. The decisive question is whether this plugin does anything that expect()->extend() and a shared bootstrap do not; if not, prefer the built-in approach.
Is pest-plugin-global-assertions safe to use in production?
It is dev-only and has zero runtime footprint, so it does not reach production code or customers. Its blast radius is contained to CI runtime and developer workflow. Keep it in require-dev and treat it as a test-authoring convenience, not a platform dependency.
Is pest-plugin-global-assertions mature enough for strict dependency governance?
The available assessment flags maturity and bus-factor risks: 7 stars, 0 dependents, single-maintainer signals, and no visible CI compatibility matrix. A strict supply-chain review may reject it because demonstrated adoption is thin. Treat it as a cheap, reversible experiment and avoid making it load-bearing without validation.
How do I remove pest-plugin-global-assertions later or migrate to local assertions?
Removal is straightforward: drop the dev dependency and move the same assertions into a local trait or expect()->extend() in tests/Pest.php. The assessment describes removal as an afternoon of work, with no migration or data changes required. Roll it out one package at a time so the fallback cost stays low.
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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core