You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe, we just need to document how we can resolve it?
class FooContext implements Context, KernelAwareContext {
publicfunctiondoSomething(...) {
$container = $this->kernel->getContainer();
// Same as the self::$container, which can access private services$privateServiceContainer = $container->has('test.service_container') ? $container->get('test.service_container') : $container;
}
}
For one more step forward, would it be more developer friendly if an interface is offered and injects the container automatically? (e.g., PrivateServiceContainerAwareContext)
The text was updated successfully, but these errors were encountered:
Objective
Should we offer the same functionality as
self::$container
in Symfony 4.1 for behat context?https://symfony.com/blog/new-in-symfony-4-1-simpler-service-testing
Related: #139
Proposed approach
Maybe, we just need to document how we can resolve it?
For one more step forward, would it be more developer friendly if an interface is offered and injects the container automatically? (e.g.,
PrivateServiceContainerAwareContext
)The text was updated successfully, but these errors were encountered: