Repository navigation
Repair wp/5.8 branch Actions: Initialize WP_Block_Supports::$block_to_render and showSubmenuIcon context in the Navigation Link render tests - #84451
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 |
fe3e8bf to
664fcb4
Compare
|
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. |
664fcb4 to
581137d
Compare
581137d to
10bd88a
Compare
…nk render tests.
…he render tests.
10bd88a to
a84abbd
Compare
Part of #82935.
What?
Two changes to
phpunit/class-block-library-navigation-link-test.php, test code only:WP_Block_Supports::$block_to_renderinsetUp()/tearDown().array( 'showSubmenuIcon' => false )as the context of the 7new WP_Block()calls.Why?
WP_Block_Supports::$block_to_renderisnullwhenget_block_wrapper_attributes()reads it (Trying to access array offset on value of type null). That is a warning, converted to an error, on PHP 8.packages/block-library/src/navigation-link/index.php:205reads$block->context['showSubmenuIcon']without checking that it is set;wp/5.9added anisset()there. With an empty context that read also errors on PHP 8.Both surface once the
PHP 8.0legs run, which #84455, later in this stack, enables. On this branch thePHP 7.4andPHP 8.0legs ofunit-test.ymlcurrently stop before any test runs (wp-phpunit/wp-phpunit5.6.0refuses PHPUnit 8 and newer), and thePHP 5.6legs stop on a PHPUnit parse error. #84455 and #84456 fix those. Only thePHP 7.0legs (PHPUnit6.5.14) run these tests today.How?
Adapted from
wp/6.0's #84286 andwp/5.9's #84419. Theblock_to_renderhunk is theirs with camelCasesetUp()/tearDown(): this branch'swp-phpunit/wp-phpunit5.6.0test case never callsset_up()/tear_down(), so the snake_case methods would never run. TheshowSubmenuIconcontext is specific to this branch.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