These are chat archives for Behat/Behat

26th
Jul 2018
Check24 ZZV
@CiderAndWhisky
Jul 26 2018 11:25
Hey, I am trying to use a DI container in Behat Contexts. At first, I used a ContextInitializer and called a setDIContainer() method, which works, but is messy and uses a lot of boilerplate code.
What I am now trying is using the ContainerBuilder that is passed to the extension, and filling it with my own services.yaml
Parameters work ok, but services are ignored.
Any ideas?
Check24 ZZV
@CiderAndWhisky
Jul 26 2018 12:06
:-O Ha, what? You can just paste your services.yaml in the behat.yaml? That is so cool!
Why is that not documented anywhere? I had to debug Behat for an hour now to stumble across that feature after several hours of trying to find other ways.
I will write a blog post on this now (german, though), maybe save some other guys a few hours of searching.