These are chat archives for Behat/Behat

30th
Sep 2014
Maxime Veber
@Nek-
Sep 30 2014 09:09
@Max101 is it ok ?
Mitja O.
@Max101
Sep 30 2014 10:38
Well not exactly. First I am not using FriendlyContexts because some parts are unstable.
And even if I were, in this particular case I am not using an Entity manager and what the FriendlyContexts actually do is a hook on BeforeScenario here:
https://github.com/KnpLabs/FriendlyContexts/blob/4f96ecc42c700b21d0eb29a1e618b713da27a5f1/src/Knp/FriendlyContexts/Context/EntityContext.php#L153-L155
So my question is basically simple: How can you get access to the SF2 container from the beforeFeature or beforeSuite events?
Maxime Veber
@Nek-
Sep 30 2014 10:39
SymfonyExtension looks like what you want in this situation.
Mitja O.
@Max101
Sep 30 2014 10:39
:D
Maxime Veber
@Nek-
Sep 30 2014 10:39
But in order to clean database you don't need the container of your application...
Mitja O.
@Max101
Sep 30 2014 10:40
I do have the symfonyExtension
Maxime Veber
@Nek-
Sep 30 2014 10:40
Behat 2 or 3 ?
Mitja O.
@Max101
Sep 30 2014 10:40
but beforeFeature and beforeSuite events have a static method access
Behat 3
Maxime Veber
@Nek-
Sep 30 2014 10:42
Sorry I didn't use enougth the sfext to help you :/ .
Mitja O.
@Max101
Sep 30 2014 10:44
Anyway, this is probably not possible to achieve the way I planned, so I'd like to know if it is possible to call some container service just after Behat (before context code runs ) and just before it shuts down... There are hackish ways to do this, but I am curious if someone maybe has a better idea?
@Nek- Thanks anyways!