You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unit tests are failing, and are very hard to debug. From what I'm seeing, in get_items(), get_block_templates() (when called with an empty array as its $query arg) is returning an empty array. OTOH, get_block_templates() has some unit test coverage itself in phpunit/class-block-templates-test.php that covers that case; so I guess the issue is with how I'm switching to the test theme.
I've tried sprinkling a few error_log()s into get_block_templates(), but those aren't surfaced to the terminal output when called through the endpoint; nor show they up in npm run wp-env logs tests.
I'm a bit stuck here. I thought it'd be a good idea to decouple our unit tests from external themes, but I'm not even sure anymore it's worth the hassle 😕
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to WordPress/wordpress-develop#1267 (comment). The relevant controller fix (ockham/wordpress-develop@2fc65d0) was carried over to Gutenberg here. This PR makes sure that tests would break without the fix.
How has this been tested?
Verify that unit tests are green in CI.
To test locally: