Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation Link: Fix PHP notices in unit tests #47070

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

Mamaduka
Copy link
Member

What?

PR fixes PHP notices generate by the Navigation Link unit tests.

Notice

PHP Notice:  Function wpdb::prepare was called <strong>incorrectly</strong>. Unsupported value type (object). Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 4.8.2.) in /var/www/html/wp-includes/functions.php on line 5838

Why?

We passed the post object to the wp_delete_post in the teardown method when it expects the post ID.

Testing Instructions

Running this command shouldn't generate the notice (see above).

npm run test:unit:php -- --filter Block_Library_Navigation_Link_Test

@Mamaduka Mamaduka added [Type] Code Quality Issues or PRs that relate to code quality [Block] Navigation Link Affects the Navigation Link Block labels Jan 11, 2023
@Mamaduka Mamaduka self-assigned this Jan 11, 2023
@Mamaduka Mamaduka requested a review from getdave January 11, 2023 14:00
Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🙇

@Mamaduka Mamaduka merged commit de0f414 into trunk Jan 11, 2023
@Mamaduka Mamaduka deleted the fix/navigation-link-unit-test-notices branch January 11, 2023 14:39
@github-actions github-actions bot added this to the Gutenberg 15.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Link Affects the Navigation Link Block [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants