Nav link block PHP tests replace prefixed function with non-prefixed #40657
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_link
with non-prefixedrender_block_core_navigation_link
in 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
![Screen Shot 2022-04-27 at 16 39 42](https://user-images.githubusercontent.com/444434/165557260-b4bed77a-0dbe-466c-a7d5-406495dc1f68.png)