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

Symfony Mocker Container Laravel Package

polishsymfonycommunity/symfony-mocker-container

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Test Automation & CI/CD Efficiency: Accelerates functional testing and Behat scenario execution by enabling mocking of Symfony services without modifying production code. Reduces flakiness in integration tests by isolating dependencies.
  • Shift-Left Testing: Enables earlier validation of business logic by mocking external services (e.g., APIs, databases) in test environments, reducing late-stage surprises.
  • Build vs. Buy: Justifies buying this lightweight package over custom solutions for teams already using Symfony, avoiding reinventing mocking infrastructure.
  • Roadmap Prioritization: Supports scaling test coverage for microservices or monoliths with complex DI graphs, especially where HTTP-driven tests are impractical.
  • Developer Experience: Reduces context-switching for QA/Dev teams by standardizing mocking patterns across functional tests and Behat scenarios.

When to Consider This Package

  • Adopt if:

    • Your stack is Symfony 2/3/4 (not Laravel; this is Symfony-specific).
    • You rely on BrowserKitDriver for functional tests (no HTTP-based drivers).
    • Mocking services is a bottleneck in CI/CD (e.g., slow tests due to real dependencies).
    • Your team uses Behat for BDD and needs seamless mocking in scenarios.
    • You prioritize test isolation over realism (e.g., mocking payment gateways, external APIs).
  • Look elsewhere if:

    • You’re using Laravel (this is Symfony-only; consider mockery or Laravel’s built-in testing tools).
    • Your tests require real HTTP requests (e.g., API contracts, frontend integration).
    • You need advanced mocking (e.g., partial mocks, dynamic stubs)—consider TestDoubleBundle (recommended by the authors).
    • Your team prefers modern PHP testing tools like Pest or PHPUnit’s native mocking.
    • You’re on Symfony 5+ (may need compatibility checks; last release was 2022).

How to Pitch It (Stakeholders)

For Executives: "This package lets our QA and dev teams mock Symfony services in tests without touching production code, cutting test execution time by ~30% in our CI pipeline. For example, we can simulate failed payments or slow APIs during Behat scenarios without external dependencies. It’s a low-risk, high-impact way to accelerate releases—especially for teams maintaining complex Symfony apps. The tradeoff? We’ll need to standardize on BrowserKitDriver for functional tests, but the speed gains justify it."

For Engineering: *"SymfonyMockerContainer replaces manual service mocking in tests with a container-level solution. Key benefits:

  • No more use Mockery clutter in test files—mocking is handled at the DI layer.
  • Behat-friendly: Mock services directly in scenarios (e.g., @When I mock the payment service to return a failure).
  • Lightweight: Adds ~50 lines of config vs. custom mocking logic. Downside: Limited to BrowserKitDriver, but that’s already our standard. Recommendation: Pilot in 1–2 high-impact test suites (e.g., checkout flow) before rolling out."*

For QA/BDD Teams: *"This tool supercharges Behat by letting you mock services in scenarios without developer help. For example:

Given the user is on the checkout page
When the payment service is mocked to throw an error
Then I should see the error page

No more waiting for real APIs or databases—just pure business logic validation. Ask devs to try it in your next sprint!"*

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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui