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.
symfony/dependency-injection). However, Laravel’s native container differs in some ways (e.g., no XML/YAML config by default), requiring adaptation.Illuminate\Container\Container) is not identical to Symfony’s DI, but Symfony’s DI can be integrated via symfony/dependency-injection or symfony/http-kernel.services.php) or Laravel’s config/services.php with manual tagging.createApplication(), refreshDatabase()) rather than Behat.fob.context_service. Requires custom logic to filter services.App::singleton()).bindInContainer(), resolve()) replace this functionality?behat/behat, symfony/messenger) that offer similar features?Testing facade (e.g., actingAs(), refreshDatabase()).bindIf() or resolvingCallbacks).context-service-extension, implement a bridge to:
config/services.php (instead of XML/YAML).$container->tag() or custom logic) to apply fob.context_service tags.// In a Behat service provider
$container->set('acme.my_context', function () {
return new Acme\MyContext();
})->withTag('fob.context_service');
bindInContainer()).v1.3.0) to avoid breaking changes.config('cache.default')) for shared services.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Package breaks with Laravel 9+ | Tests fail silently or throw errors | Pin to PHP 7.4 or use a compatibility layer |
| Symfony DI conflicts with Laravel | Container resolution errors |
How can I help you explore Laravel packages today?