Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide context argument resolver in addition to *AwareContext #2

Open
everzet opened this issue Jan 17, 2015 · 1 comment
Open

Provide context argument resolver in addition to *AwareContext #2

everzet opened this issue Jan 17, 2015 · 1 comment

Comments

@everzet
Copy link

everzet commented Jan 17, 2015

KernelAwareContext injects entire application into your context, which in most cases is not what you want. You'd usually want couple of services injected into the context constructor instead of the entire container.

Behat 3 has the extension point called context ArgumentResolver:
https://github.com/Behat/Behat/blob/master/src/Behat/Behat/Context/Argument/ArgumentResolver.php

By implementing this extension point you could hook Behat into Laravel, so that it would automatically inject services from the container using the argument typehints, for example. Here's how we do it in Symfony extension:
https://github.com/Behat/Symfony2Extension/blob/master/src/Behat/Symfony2Extension/Context/Argument/ServiceArgumentResolver.php

@JeffreyWay
Copy link
Collaborator

Cool. Will look into implementing this very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants