Repository navigation
Repair wp/5.9 branch Actions: Add wpop_keywords to the pattern directory test fixtures - #84423
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
072ed69 to
4a9d3c7
Compare
|
Size Change: 0 B Total Size: 1.11 MB ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
4a9d3c7 to
3d3ec0d
Compare
3d3ec0d to
77a14da
Compare
77a14da to
c40f1a6
Compare
andrewserong
left a comment
There was a problem hiding this comment.
LGTM and matches how the core fixtures work 👍
Part of #82934.
What?
Fixes the pattern directory REST controller tests (
phpunit/class-wp-rest-pattern-directory-controller-test.php):"wpop_keywords": ""to themetaof every pattern in the four fixtures inphpunit/fixtures/rest-api/pattern-directory/.test_get_items_by_keyword()that asserted every returned pattern has thecorekeyword.Why?
WordPress 5.9 ships its own
WP_REST_Pattern_Directory_Controller, so theclass_exists()check inlib/load.phpskips Gutenberg's copy and these tests run against core's class. Core's class reads each pattern's keywords frommeta->wpop_keywords, but the fixtures only havekeyword_slugs, which Gutenberg's class read:Undefined property: stdClass::$wpop_keywords(class-wp-rest-pattern-directory-controller.php:216).test_get_items_by_keyword()fails onassertContains( 'core', ... ).How?
Matches WordPress 5.9's own tests for this controller: core's fixtures (
tests/phpunit/data/blocks/pattern-directory/on the5.9branch of wordpress-develop) have"wpop_keywords": ""in the same place, and core'stest_get_items_by_keyword()has nocorekeyword assertion.keyword_slugsis kept in the fixtures.Trunk removed these tests and fixtures instead, in #38273 (596afcc), when the plugin's minimum WordPress version became 5.8.
Use of AI Tools
This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.
🤖 Generated with Claude Code