-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Tests: Add unit test for empty comment tags in export #8383
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
base: trunk
Are you sure you want to change the base?
Tests: Add unit test for empty comment tags in export #8383
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
desrosj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of output buffering within this method, can we utilize the get_the_export() method in this class to instead fetch the entire export XML string? Then the same checks can be performed using xpath().
bac329b to
3e99f4c
Compare
Yes, I completely missed that. Thanks for pointing out. |
e599235 to
3b0a984
Compare
westonruter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, but just a couple suggestions for the tests.
3b0a984 to
e2f5e81
Compare
|
I think the failing test is unrelated to the changes in the PR. |
…lean up variable assignments
… WP_Comment instances are included
e2f5e81 to
141982e
Compare
Trac ticket: https://core.trac.wordpress.org/ticket/61244
This PR adds unit tests for the patch present to verify the behavior of comment filtering during exports.
The new test ensures that when comments are filtered out using
get_commentfilter, no empty<wp:comment>tags appear in the export XML.Run the tests: