pestphp/pest-plugin-expectations
An extension for the Pest PHP testing framework that adds extra expectation APIs, letting you write fluent, readable assertions with expect(). It supports custom expectation creation and ships additional built-in expectations for cleaner, more expressive test suites.
expect($order)->toBePaid(): assertions written as domain vocabulary rather than framework primitives. The product decision underneath — how much domain language belongs in the test suite — drives onboarding speed, review quality, and how quickly a new engineer can tell what a test guarantees versus how it does it. This repo is a useful reference for framing that decision even though it is the wrong delivery vehicle for it.Consider it only under narrow, verifiable constraints:
expect() and custom expectation authoring did not exist natively, and a framework upgrade is genuinely blocked by PHP version, CI image, or other pinned packages.src/, do not install.Look elsewhere — and by default do not adopt — when:
composer why-not on a disposable branch, or assume unsupported.Net: this is an obsolescence case, not an adoption case. The capability is worth funding; this package is not the delivery vehicle.
Executive summary. This is a small, archived 2021 plugin that added reusable, readable "expectation" assertions to Pest and PHPUnit. The capability — domain-specific assertions that make tests self-documenting — is genuinely valuable for onboarding speed, review quality, and regression confidence. The package is not: it is unmaintained, has zero dependents, and its functionality has been superseded by Pest's built-in expectation API.
Recommendation. Do not adopt, and do not budget for it. If the team wants custom expectations, implement them as a small in-house extension on Pest core — roughly a day of engineering, MIT-compatible, zero licensing cost, zero supply-chain exposure. This is a "use the native feature" decision, not a build-vs-buy decision.
For engineering. Treat the repository as a reference implementation and a cautionary example, not a dependency. Any existing usage should be flagged for replacement in the next Pest/PHPUnit upgrade cycle. Scope is small and low-risk, but sequence it as its own change window — never alongside a framework or PHP upgrade, because dependency-resolution failures are the hardest to debug.
Risk if we adopt anyway. Archived code with no maintainer, unverified compatibility with modern PHP and PHPUnit, a hard ceiling on future framework upgrades, and a mandatory migration later. The cost of doing nothing is near zero; the cost of adopting is a future forced refactor plus developer time lost to resolution failures. The main thing to protect against is institutional drift — new joiners assuming the package is current and supported — so any retained legacy usage needs a one-paragraph ADR stating what it is, why it exists, and what retires it.
How can I help you explore Laravel packages today?