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

Update Documentation for Reusable Bundle Best Practices to Mention Testing Extension #5901

Closed
ReservedDeveloper opened this issue Nov 23, 2015 · 4 comments

Comments

@ReservedDeveloper
Copy link

Update:
After some back and forth, realized the issue that was going on was at a more root-level. Based on that, it may be helpful to add some documentation to the Reusable Bundle best practices to mention adding testing for any created Extensions to verify configuration parsing.

Original issue below:

This is a follow up in relation to #5059. Presently, there does not seem to be a clear way to utilize the PHPUnit Bridge library in conjunction with a reusable bundle configuration.~~

I installed this library for a current project and started receiving deprecation notices from a self-maintained dependency. After installing it on the dependency, I'm not getting any deprecation notices. I'm not sure if its a matter of misconfiguration in the dependency project, or that the bridge package isn't set up to handle reusable bundles.

It would be helpful if the documentation were updated to cover that use case, or updated to reflect that not being a valid approach.

@ReservedDeveloper
Copy link
Author

See here for my SO post detailing my setup a bit more (and a bounty, if someone can help sort this out!).

Also, ping to @nicolas-grekas @xabbuh and @wouterj, who I suspect will be best equipped for this task.

@nicolas-grekas
Copy link
Member

IMHO, the doc/README is fine, it tells what it should tell.
If you get more notices on your bundle than in your dependency, it means you are missing some tests cases in your dependencies and that your bundle runs throught code paths that are not taken by your dependencie's test suite.

@ReservedDeveloper
Copy link
Author

@nicolas-grekas that is true. In my case, since this is a reusable bundle, none of the service configuration code is hit directly, since that's the responsibility of the dependent project to load up and parse.

I think ultimately, I need to take an approach similar to the FOS Rest bundle in testing the Extension class, which should resolve the unparsed code issue. Perhaps this approach would be worth mentioning in the Reusable Bundles best practices section. Good for testing all lot of those annotation/configuration type issues.

@ReservedDeveloper ReservedDeveloper changed the title Update Documentation of Symfony PHPUnit Bridge for Reusable Bundles Update Documentation for Reusable Bundle Best Practices to Mention Testing Extension Nov 25, 2015
@javiereguiluz
Copy link
Member

Let's close this old issue. Although is true that testing this extension may be a good idea for complex bundles ... I think it's "too much" for most bundles. Let's not add a best-practice recommendation for this yet. We may reconsider this in the future, when we update the docs for creating reusable bundles. Thanks!

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

No branches or pull requests

3 participants