-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Font Library: Do not register the google fonts collection if already registered #58769
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 SVNCore Committers: Use this line as a base for the props when committing in SVN:
GitHub Merge commitsIf 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. |
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.5/fonts/fonts.php ❔ phpunit/tests/fonts/font-library/wpRestFontCollectionsController.php |
Looks like there's some php unit test failures 🤔 |
@matiasbenedetto any idea what's happening with the php test failures here? |
This error message also needs grammar updating to
|
Failed asserting that actual size 2 matches expected size 1. It seems like the This is the assertion failing:
It seems unrelated to this PR and produced by the double registration of the font collection endpoint (in core and in the plugin). gutenberg/lib/compat/wordpress-6.5/fonts/fonts.php Lines 102 to 106 in ff37abf
|
It seems that the practice for other endpoints has been to double the expect call in the tests. So I did that in the last commit. I think personally that we could consider removing this kind of assertions entirely, but let's leave that separate. |
Actually, I just went ahead and removed these two assertions from this test. |
Now the Rest API is merged into core, could we remove the tests for the font library rest API endpoints entirely? |
@matiasbenedetto I think so yes, since the class being tests is actually the one in Core (due to the class_exists check), but let's do that in its own PR. |
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.
LGTM
…registered (#58769) Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: getdave <get_dave@git.wordpress.org> Co-authored-by: matiasbenedetto <mmaattiiaass@git.wordpress.org>
What?
In order to test this properly, you'll have to run this PR on top of the following Core patch WordPress/wordpress-develop#6056
You shouldn't see any error due to "double registration of google-fonts" collection.
This PR is blocking the introduction of the google fonts collection into Core.