Closed gorghoa closed 8 years ago
Better use service decoration, but Behat only supports symfony/dependency-injection
2.1. This feature is from 2.7.
Check https://github.com/Behat/Behat/issues/914 for more infos
Let's add symfony/dependency-injection
2.7 as dependency to your library first, waiting Behat to update its dependencies.
@vincentchalamon Behat supports any version starting with 2.1 (including the 3.0 branch). It's up to you to force higher version if you need one.
Yep, that's what I did in composer.json Thanks @jakzal
As in v1.0.0-rc.1, we hooked into the steps methods injection by replacing (through dependency injection), the original
PregMatchArgumentOrganiser
.https://github.com/gorghoa/ScenarioStateBehatExtension/blob/v1.0.0-rc.1/src/ServiceContainer/ScenarioStateExtension.php#L76
Then, we mimic more preg_match captures from the store.
Finally, we call the original
PregMatchArgumentOrganiser
with our enhanced preg_matchic results…https://github.com/gorghoa/ScenarioStateBehatExtension/blob/v1.0.0-rc.1/src/ScenarioStateArgumentOrganiser.php#L35
That seem a bit hacky and maybe there is a more intended way to go…