Nav link block PHP tests replace prefixed function with non-prefixed#40657
Merged
Nav link block PHP tests replace prefixed function with non-prefixed#40657
Conversation
Contributor
Super weird! cc @youknowriad @gziolo |
adamziel
approved these changes
Apr 29, 2022
Member
It's only the case when you run That's the risk of doing too much magic in the build process. |
adamziel
pushed a commit
that referenced
this pull request
May 3, 2022
…xed render_block_core_navigation_link in the unit tests (#40657)
Contributor
|
I cherry picked this change into |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What?
Replaces the usage of prefixed
gutenberg_render_block_core_navigation_linkwith non-prefixedrender_block_core_navigation_linkin the PHP Unit tests.Here's an example where they are failing:
https://github.com/WordPress/gutenberg/runs/6195031409?check_suite_focus=true
Why?
It looks like the Nav Link block PHP Unit tests have been relying on the
gutenberg_prefixed version of the block's render function.gutenberg/phpunit/class-block-library-navigation-link-test.php
Line 105 in b8aa52d
However, this function does not exist in Gutenberg Core so I assume it existed in WP Core. It looks like it was recently removed and thus causes a bug in the PHP unit tests.
How?
Just renaming.
Testing Instructions
Run PHP unit tests for
phpunit/class-block-library-navigation-link-test.php. Check no failures.Screenshots or screencast
Example of failing tests
