Weave 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

Mockery Bundle Laravel Package

polishsymfonycommunity/mockery-bundle

Symfony bundle that integrates Mockery into the dependency injection container. Autowire the Mockery service, build container-aware mocks, and simplify test doubles in unit and functional tests without manual setup or boilerplate.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

  • Architecture fit: Poor for a standard Laravel application. polishsymfonycommunity/mockery-bundle is a Symfony Bundle that integrates Mockery with Symfony’s service container so services can be mocked in Behat. Laravel is not Symfony Bundle-based and already includes native Mockery support plus container/facade test helpers. Adopting this would add a Symfony-specific abstraction for behavior Laravel already supports.
  • Integration feasibility: Low without custom compatibility work. The bundle assumes Symfony bundle registration, kernel/service-container lifecycle, and Behat/Symfony extension conventions. Laravel lacks bundle registration, and the package shows 15 stars and 0 dependents, so there is no evidence of Laravel adoption. It is feasible only as a reference implementation or in a mixed Symfony/Laravel estate where Behat and Symfony-style service mocking are mandatory.
  • Technical risk: High. Risks include low adoption, likely stale Symfony/PHP version constraints, coupling to container internals, no Laravel support surface, and abandonment/update lag. Mockery itself is mature; the bundle is the risky layer. A TPM should treat it as a test-only, legacy-Symfony dependency at best, not a production dependency.
  • Key questions: Do we actually run Behat? Are we trying to mock Laravel services in acceptance tests? Which Laravel, PHP, Symfony, Behat, and Mockery versions must be supported? Can Laravel container bindings plus Mockery, Pest, or PHPUnit satisfy the same need? Is there a legacy Symfony service that must remain interoperable? What is the exit plan if the package is abandoned?

Integration Approach

  • Stack fit: Not a fit for a normal Laravel stack. Laravel already provides Mockery, $this->mock(), $this->partialMock(), facade mocking, and app()->instance() for container substitution. If Behat is required, use a Laravel-aware Behat bootstrap and Laravel-native test doubles rather than a Symfony Bundle.
  • Migration path: Do not migrate a Laravel test suite onto this bundle. If inherited in a mixed codebase, isolate it behind a test-only compatibility layer, map Symfony service IDs to Laravel container bindings, and document removal criteria. For a legacy Symfony app, adopt it only inside the Behat test bootstrap and pin versions.
  • Compatibility: Validate PHP, Symfony, Behat, Mockery, and Laravel constraints before any spike. Expect conflicts because the bundle assumes Symfony kernel and service-container behavior. It is not a first-class Composer package for Laravel and would require custom bootstrap work.
  • Sequencing: 1) Confirm the acceptance-test gap and whether Behat is truly required. 2) Spike one service mock using Laravel-native Mockery and container binding. 3) Compare only if a Symfony bridge is unavoidable. 4) Contain any adoption to test dependencies with CI matrix coverage. 5) Otherwise reject and standardize on Laravel testing primitives.

Operational Impact

  • Maintenance: High relative to value. With 15 stars and 0 dependents, community maintenance is minimal. Adoption implies willingness to fork or patch. Native Laravel/Mockery avoids this bundle maintenance burden.
  • Support: Low external support. There is no vendor SLA, no Laravel community backing, and likely limited issue triage. An internal owner and documentation would be mandatory if used.
  • Scaling: Poor as a cross-team standard for Laravel. It creates a Symfony-specific testing pattern and slows onboarding. Standardizing on Laravel-native mocks scales better across services, CI pipelines, and engineering teams.
  • Failure modes: Bundle/kernel boot failures, service-container mismatch, version conflicts, brittle Behat context coupling, mock leakage across scenarios, and abandoned-dependency blockers during PHP/Laravel upgrades. These are test-environment failures but can block CI and releases.
  • Ramp-up: Moderate to high for Laravel engineers because they must learn Symfony bundle/container semantics and Behat integration for a problem Laravel already solves. Ramp-up is justified only for teams already fluent in Symfony and Behat. Recommendation: do not adopt for Laravel; use native Mockery/Laravel testing and treat this package as legacy Symfony/Behat-only or a reference implementation.
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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums