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

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

At a glance

Frequently asked questions about Mockery Bundle
Is polishsymfonycommunity/mockery-bundle compatible with Laravel?
No, it is a Symfony bundle built for Symfony's kernel and service container, not Laravel. Laravel is not bundle-based, so the package will not register or autowire the same way. It is only feasible in a mixed Symfony/Laravel estate or as a reference implementation.
Can I use this Mockery bundle in a Laravel application?
You can install it with Composer, but integrating it requires custom compatibility work for Symfony bundle registration and container lifecycle. Laravel already includes Mockery and test helpers, so there is no practical reason to adopt this bundle. Treat it as a test-only legacy Symfony dependency at best.
How do I install polishsymfonycommunity/mockery-bundle?
Install it with Composer using composer require polishsymfonycommunity/mockery-bundle. In Symfony, you then register the bundle in the kernel and configure it for your Behat test bootstrap. For Laravel, installation alone is not enough because there is no bundle registration mechanism.
What Laravel version does mockery-bundle support?
The package does not target Laravel and has no documented Laravel support surface. It is a Symfony-oriented bundle with likely Symfony and PHP version constraints that may conflict with modern Laravel projects. Validate all Composer constraints before any spike.
How does this bundle compare to Laravel's built-in mocking helpers?
Laravel provides native Mockery support plus $this->mock(), $this->partialMock(), facade mocking, and app()->instance() for container substitution. This bundle adds a Symfony-specific abstraction for behavior Laravel already supports. Laravel-native helpers are simpler, better documented, and scale across teams.
Can I use this bundle for Behat testing in Laravel?
Only with custom work: the bundle assumes Symfony bundle registration and Behat/Symfony extension conventions that Laravel lacks. If Behat is mandatory, use a Laravel-aware Behat bootstrap with Laravel-native test doubles instead. Avoid mapping Laravel services through a Symfony container abstraction unless a legacy service forces it.
What are the risks of using a Symfony bundle in Laravel?
Risks include bundle/kernel boot failures, container mismatch, version conflicts, and brittle Behat context coupling. The package has 15 stars and 0 dependents, so community maintenance and issue triage are minimal. Adoption implies willingness to fork or patch during PHP and Laravel upgrades.
How do I mock Laravel services in acceptance tests instead?
Use Laravel's container binding with app()->instance() or bind a mock class, then resolve it normally in your acceptance test bootstrap. Combine that with Mockery, Pest, or PHPUnit helpers such as $this->mock() for unit and functional tests. This keeps test doubles native to Laravel and avoids Symfony bundle dependencies.
Is polishsymfonycommunity/mockery-bundle maintained and safe for production?
It is a test-only integration layer with low adoption and no vendor SLA, so production use is not appropriate. Mockery itself is mature, but the bundle is the risky layer due to potential abandonment and update lag. An internal owner and removal plan would be mandatory if inherited.
What alternatives should Laravel developers use instead of this bundle?
Use Laravel's built-in Mockery integration, $this->mock(), partial mocks, facade fakes, and container bindings. For Behat, use a Laravel-aware bootstrap and native test doubles rather than a Symfony bundle. If a legacy Symfony service must interoperate, isolate it behind a test-only compatibility layer.
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.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle