bovigo/callmap
Stub and mock PHP method and function calls via a callmap. Define fixed returns, callbacks, consecutive results, or thrown exceptions, then verify invocations and arguments. Works with any unit test framework; argument checks via bovigo/assert or PHPUnit.
Architecture fit: The package provides a callmap-based mocking solution compatible with any PHPUnit-based test framework, making it technically feasible for Laravel's testing stack. However, Laravel's ecosystem heavily relies on PHPUnit's built-in mocking and Mockery, creating potential redundancy. It uniquely supports mocking global functions (unlike PHPUnit's native capabilities), which could fill a specific gap for legacy code testing.
Integration feasibility: Low. Requires PHP 8.3+ (Laravel 10 supports up to 8.2), creating immediate version compatibility issues. Composer installation is straightforward but conflicts with Laravel's default testing conventions. The package's "any unit test framework" claim is misleading since it depends on PHPUnit or bovigo/assert for argument verification, forcing additional dependencies in a project that already uses PHPUnit.
Technical risk: High. Zero dependents on Packagist indicates no real-world usage, suggesting unproven stability. The "2025-12-07" release date is impossible (current year is 2023), indicating data corruption or inactive maintenance. Documentation lacks concrete Laravel-specific examples, and the package's core functionality overlaps with Laravel's existing testing tools (e.g., mock() helper).
Key questions: Why has this package zero dependents despite existing for years? How does it compare to Mockery or Prophecy in real Laravel projects? Is the maintainer actively addressing issues? What's the actual maintenance status given the invalid release date?
Stack fit: Poor. Laravel's testing layer abstracts PHPUnit heavily, while this package requires direct interaction with NewInstance and verify() APIs. This creates a disjointed testing experience where developers must switch between Laravel's fluent test syntax and this package's imperative style. No native Laravel integration points exist (e.g., no service provider or facade support).
Migration path: High effort. Requires rewriting all existing tests using PHPUnit/Mockery to use this package's syntax. No automated migration tools exist. Legacy code with global functions might benefit, but new Laravel projects should use Laravel's built-in mocking or Mockery instead. Would require significant team retraining due to non-standard API patterns.
Compatibility: PHP 8.3 requirement blocks Laravel 10 (which supports 8.2). Laravel 11+ may support 8.3, but this package's lack of adoption makes it a risky dependency. Conflicts with Laravel's TestCase class where mock() is already defined. No compatibility guarantees with Laravel's testing utilities like Http::fake().
Sequencing: Not recommended for any new or existing project. If absolutely necessary, use only for isolated global function mocking in legacy code, but avoid in modern Laravel development. Prioritize Laravel's native mocking or Mockery for all new tests.
Maintenance: High risk. Zero dependents and suspicious release data suggest abandonment. No recent commits (last activity in 2023), and GitHub issues show no active maintenance. No community support channels beyond GitHub issues, which likely go unanswered.
Support: Minimal. Only the original maintainer can provide support, with no indication of responsiveness. No Stack Overflow coverage or community resources exist. Documentation is sparse on Laravel-specific use cases, forcing developers to reverse-engineer behavior from limited examples.
Scaling: Low impact on test performance since it's a test utility, but complex callmap chains could make tests harder to debug. No known scaling limitations, but the package's unproven
How can I help you explore Laravel packages today?