I want to use behat with symfony flex When i inject service in behat context file inside constructor, the autowire dont works. I need to explicitly configure service to public to use that service in behat. Is there another way to inject service in behat context file without making it public?
Here i am getting below error The "App\DataConsumer" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.
behat.yml
default:
suites:
default:
contexts:
- FeatureContext:
kernel: '@kernel'
- ImageConsumerContext:
dataConsumer: '@App\DataConsumer'