timacdonald/callable-fake
A tiny PHP testing utility for faking/invoking callables. CallableFake lets you replace closures or invokable objects, record calls and arguments, assert usage, and return configured values—useful for isolating behavior in PHPUnit/Laravel tests.
Adopt if:
Look elsewhere if:
Mockery).Mockery or PHPUnit's native tools.pestphp/pest-plugin-mocks).For Executives: "This lightweight package lets our PHP team test complex callable logic faster and more reliably by faking closures/middleware—reducing flaky tests tied to external services. It’s a low-risk upgrade (MIT license, PHP 8.2+ support) that aligns with our modern stack and cuts test maintenance time by 20–30%."
For Engineering: *"CallableFake is a PHPUnit-compatible utility to mock closures with precision:
assertCalledTimes(3)).For QA/DevOps: "This tool speeds up CI/CD by isolating tests from external services. For example, testing a Laravel event listener now requires no database/API setup—just fake the closure and verify its behavior. Reduces test flakiness and false positives."
How can I help you explore Laravel packages today?