Weave Code
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 Laravel Package

pestphp/pest

Pest is an elegant PHP testing framework focused on simplicity and developer joy. Write expressive, modern tests with a clean syntax, powerful expectations, and a great DX for PHP projects—built for fast feedback and readable suites.

View on GitHub
Deep Wiki
Context7

Pest is an elegant PHP testing Framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP.

Frequently asked questions about Pest
Can I use Pest with Laravel 8.x or older versions?
Pest v4 drops support for Laravel <8.0, but you can pin to Pest v3 for older Laravel versions. Check the [Pest docs](https://pestphp.com) for version compatibility. If you’re on Laravel 8+, Pest v4 offers Playwright browser testing and improved Laravel assertions.
How do I migrate from PHPUnit to Pest without breaking existing tests?
Pest is a drop-in replacement—just install it via Composer (`composer require pestphp/pest --dev`) and run `php artisan pest:install`. Existing PHPUnit tests will continue working, and you can gradually rewrite them in Pest’s syntax. Use the `--parallel` flag to run both suites simultaneously during migration.
Does Pest support Laravel’s HTTP testing helpers like `actingAs()` or `followRedirects()`?
Yes, Pest fully supports Laravel’s testing utilities out of the box. The `laravel` preset auto-loads helpers like `actingAs()`, `followRedirects()`, and `toHaveValidationError()`. No additional configuration is needed for Laravel-specific assertions.
Will Pest slow down my CI pipeline, or does it speed it up?
Pest *speeds up* CI by default—it uses parallel execution (via ParaTest) to reduce runtime by up to 70%. Enable it with `pest --parallel` or configure it in your `phpunit.xml`. For large suites, use `--shard` to split tests across CI workers and avoid timeouts.
Can I write end-to-end (E2E) browser tests with Pest?
Yes, Pest v4+ includes Playwright integration for E2E testing. Install the plugin with `composer require pestphp/pest-plugin-browser --dev`, then use Pest’s familiar syntax for browser interactions. This eliminates the need for separate Cypress or Playwright setups.
How does Pest enforce clean architecture in Laravel apps?
Pest provides assertions like `toUseTrait()`, `toExtend()`, and `toHaveSuspiciousCharacters()` to statically analyze code structure. Use these in CI or PR checks to enforce architecture rules (e.g., banning service containers in models). False positives can be addressed with custom expectations.
Are there any breaking changes when upgrading from Pest v3 to v4?
Pest v4 introduces Playwright browser testing and drops Laravel <8.0 support, but most syntax changes are backward-compatible. Review the [upgrade guide](https://pestphp.com/docs/pest-v4-upgrade) for plugin-specific changes. Run `pest --version` to check your installed version.
How do I debug failing tests in Pest, especially with parallel execution?
Use Pest’s built-in `dd()` or `dump()` functions for debugging. In parallel mode, ensure your CI logs include the `--shard` flag to identify which worker failed. For Playwright tests, use `browser.debug()` to pause and inspect the browser during test execution.
What alternatives to Pest exist for Laravel testing?
The main alternatives are PHPUnit (native) and Laravel’s built-in testing helpers. PHPUnit is more verbose but widely supported; Pest offers a simpler syntax while maintaining 100% PHPUnit compatibility. For browser testing, Cypress or Playwright standalone are options, but Pest’s Playwright plugin unifies the workflow.
How can I enforce Pest usage across my team without disrupting legacy PHPUnit tests?
Start by mandating Pest for *new* tests only, then gradually migrate legacy tests. Use Composer scripts to run both suites in CI (e.g., `phpunit` for legacy, `pest` for new). For teams, provide pair programming sessions to accelerate adoption. Pest’s `--filter` flag helps isolate new vs. old tests during transition.
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.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony