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

Add autowiring and autoconfiguration for methods #62

Open
pamil opened this issue Feb 4, 2019 · 3 comments
Open

Add autowiring and autoconfiguration for methods #62

pamil opened this issue Feb 4, 2019 · 3 comments
Labels

Comments

@pamil
Copy link
Member

pamil commented Feb 4, 2019

It would be great to support autowiring and autoconfiguration for methods defining steps and transformations:

/**
 * @Given there is a product :productName
 */
public function thereIsProduct(string $productName, ProductRepository $productRepository): void
{
    $this->productRepository->add(new Product($productName));
}

The logic would be similar to the one used by Symfony for their controllers: https://symfony.com/doc/current/controller.html#fetching-services

@pamil pamil added the Feature label Jan 13, 2020
@Guikingone
Copy link

Hi @pamil 👋

Is this issue currently under work?

I'm asking due to your recent Behat roadmap, maybe we can work on this feature (as it's not really complicated in recent Sf iterations) in order to release it in the future? 🤔

@pamil
Copy link
Member Author

pamil commented Jun 2, 2020

I haven't found any time to work on this one, but I'll be glad to help with it.

In Behat it is currently implemented to support helper containers: Behat/Behat#1071.

@Guikingone
Copy link

Guikingone commented Jun 2, 2020

Thanks for the feedback, I'm gonna start a first POC in order to see how it can be implemented 🙂

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

No branches or pull requests

2 participants