-
Notifications
You must be signed in to change notification settings - Fork 45
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
Ability to configure a container to inject dependencies in PHPat tests #298
Comments
PHPat is framework-agnostic. If your tags are declared via class attribute, you can enforce X classes to apply an attribute (I think not with specific parameters atm), but you cant enforce stuff that requieres the tool to "understand" Symfony. |
I fully understand (and support) the neutrality of this library. Anyway, I think that my case could be of more general interest, when someone could need adding a generic dependency (using a constructor injection of any other possible method) when defining a rule |
I'm not sure I understand what you mean by adding a generic dependency. Your test classes can have a constructor and you can add any logic you need as long as the rule methods start by |
That's exactly my point: the constructor is useless if you can't pass arguments |
Question
I have a Symfony project with some tagged services, and I'd like to enforce that every class implementing a given interface has the expected tag applied in the container.
I was wondering if this could be currently feasible using phpat... I've read the documentation, checked the examples, and got an idea about how a custom rule is built, but in my specific case I'd need something where I could inject the container, which seems not possible to me.
Am I missing something? If not, do you think it could be implemented somehow in the future?
Or maybe you have some alternate suggestions about how could I enforce my costraint?
Thanks in advance
The text was updated successfully, but these errors were encountered: