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

Prophecy Phpunit Laravel Package

phpspec/prophecy-phpunit

Integrates the Prophecy mocking library with PHPUnit for simpler, cleaner test doubles. Install via Composer and use the ProphecyTrait to call prophesize() inside your TestCase, set method predictions/returns, and reveal mocks for injection.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Test Quality & Maintainability: Enables teams to write expressive, maintainable unit tests using Prophecy's API over PHPUnit's native mocks, reducing flakiness and improving test coverage for complex dependencies.
  • Build vs Buy Decision: Eliminates need for custom mocking solutions or manual integration work; leverages established, MIT-licensed package with active maintenance (PHPUnit 13 compatibility as of v2.5.0), making it a clear "buy" decision for Laravel projects.
  • Roadmap Alignment: Supports modern PHP 8.2+ and PHPUnit 10+ ecosystems, ensuring compatibility with upcoming Laravel versions while future-proofing test infrastructure.
  • Use Case Focus: Critical for teams building service-oriented architectures or complex domain models where precise mock behavior (e.g., argument constraints, dynamic return values) is essential for reliable test isolation.

When to Consider This Package

Adopt when using PHPUnit 9.1+ (where Prophecy isn’t natively integrated), PHP 8.2+, and needing more flexible mocking than PHPUnit’s built-in capabilities. Ideal for Laravel projects with dependency injection-heavy codebases where test clarity and precision matter. Look elsewhere if using PHPUnit <9.1 (which includes Prophecy natively), **non-PHP

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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai