-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block Bindings API: Add tests and fix newly discovered edge cases #57899
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ phpunit/experimental/WP_Block_Bindings_Test.php ❔ lib/experimental/block-bindings/class-wp-block-bindings.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questions for reviewers regarding this first pass on the tests:
- I was unable to get these tests to run locally without making the name of the test file match the name of the test class. Should we just rename the file to follow the convention of the rest of the tests?
- I needed to include the Block Bindings code with
set_up_before_class
when running the tests because it's currently locked behind an experiment. Should we leave this in for now? - How do these tests look? Are there any cases we should add or modify?
5032059
to
d0ecd52
Compare
@artemiomorales I think that we can close this one as the tests will live in Core: WordPress/wordpress-develop#5888 The bugfix is also present in the PR to Core. |
Ok sounds good — we can backport to Gutenberg once the core PR lands. |
What?
This PR adds tests for the Block Bindings API, first introduced in #57249 and refactored in #57742. It also fixes bugs that were discovered as a result of writing the tests.
Why?
In order to merge this functionality for WP 6.5, we need tests to ensure code quality into the future.
Testing Instructions