friends-of-behat/context-service-extension
Deprecated Behat extension that lets you register Behat context classes as Symfony DI services and load them into a scenario-scoped container via imported service config files (XML/YAML/PHP), using the fob.context_service tag.
SymfonyExtension v2, but may still be relevant for legacy systems.Adopt if:
Look elsewhere if:
behat/symfony-extension).For Executives: "This package lets us treat Behat contexts like Symfony services—reducing duplicate code, improving test reliability, and aligning with our PHP/Symfony stack. It’s a lightweight way to modernize our test suite without rewriting everything. While deprecated, it’s a stable stopgap for teams using older Symfony versions or needing DI for contexts. Long-term, we’d migrate to SymfonyExtension v2, but this buys us time to refactor."
For Engineering:
*"If we’re already using Symfony’s DI, this lets us define Behat contexts as services (e.g., @acme.api_client for API tests) with tags and autowiring. Key benefits:
use statements or constructor chaining.services.yml/services.xml.
Tradeoff: Deprecated, but trivial to replace later. Only worth it if we’re DI-heavy or migrating from v1."*For QA/Test Teams:
"This makes it easier to share reusable test logic (e.g., a UserContext with a pre-configured API client). Instead of copying/pasting setup code, we define it once in services.yml and reuse it across features. Think of it like ‘dependency injection for tests.’"
How can I help you explore Laravel packages today?