-
Notifications
You must be signed in to change notification settings - Fork 88
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
Improve PHPUnit integration tests #299
Comments
As this is for testing only, I don't think it is that big of a deal, tbh, and it would solve a lot of issues with the current setup. We could even go so far as to have a package be pulled in that manages all of the files that would normally be scaffolded, which then makes the entire thing |
+1 to this idea. It's worth mentioning that as of WP 5.8.2 it looks like the current testing setup is broken due to the missing polyfills. 5.8.1 still works. |
Correct: the test changes from |
Is there documentation on how the polyfill should be setup? I looked at I ended up running |
As per the description, the script currently expects |
@grappler Are you by chance looking for this write-up about it ? https://make.wordpress.org/core/2021/09/27/changes-to-the-wordpress-core-php-test-suite/ (In particular the "What does this mean for plugins/themes running integration tests based on the WP Core test suite?" section - bullet 4)
That is the right way to do it. If you can't (or don't want to) add a You can also have a look at the WP Test Utils repo which can handle the bootstrapping for you and plays nice with the |
Thanks @jrfnl! It is clearer now. I knew about the write-up, but missed the section regarding the plugins. |
@grappler Glad it helped ;-) |
@swissspidy Want to put together a pull request for this? |
Not sure I have bandwidth for that right now unfortunately |
Feature Request
Describe your use case and the problem you are facing
#297 sort of fixed testing on WP trunk, but it requires setting the
WP_TESTS_PHPUNIT_POLYFILLS_PATH
environment variable.Forcing devs to run a command like this is not ideal:
Describe the solution you'd like
Should the PHPUnit polyfills automatically be included in the scaffolded plugin? If so, how? Introducing composer would be quite the change.
Should we perhaps hardcode the polyfills path in the bootstrap file instead of checking an env var?
The text was updated successfully, but these errors were encountered: