-
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
Fix font library unit tests nit-picks [round 2] #58612
Fix font library unit tests nit-picks [round 2] #58612
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 SVNIf you're a Core Committer, use this list when committing to
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❔ phpunit/tests/fonts/font-library/fontFamilyBackwardsCompatibility.php ❔ phpunit/tests/fonts/font-library/wpFontCollection/loadFromJson.php ❔ phpunit/tests/fonts/font-library/wpFontLibrary/getFontCollections.php ❔ phpunit/tests/fonts/font-library/wpFontLibrary/unregisterFontCollection.php ❔ phpunit/tests/fonts/font-library/wpRestFontCollectionsController.php ❔ phpunit/tests/fonts/font-library/wpRestFontFacesController.php |
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.
These fixes look good to me. Thank you.
What?
Updates the Font Library's PHPUnit tests to comply with the WordPress Core Test coding standards and practices.
Follow-up from #58502.
WP_Test_REST_TestCase::assertErrorResponse() doesn't adhere to the coding standards, so I've created a Trac ticket to address that as well: https://core.trac.wordpress.org/ticket/60426.
Why?
To prepare the test suite for Core sync / merge, as these changes will get flagged in review. By fixing them now, it can help to reduce the review time and change requests at Core merge time.
How?
$post_ids_to_delete
in theTests_Font_Family_Backwards_Compatibility
class, as it's unnecessary.json_encode
withwp_json_encode
in themock_request
method within thewpFontCollection/loadFromJson.php
file to ensure consistent JSON encoding.json_encode
withwp_json_encode
in themock_request_missing_slug
method within thewpFontCollection/loadFromJson.php
file to ensure consistent JSON encoding.test_should_get_mock_font_collection
method in thewpFontLibrary/getFontCollections.php
file to fix a typo in the word "Should."unregister_non_existing_collection
method in thewpFontLibrary/unregisterFontCollection.php
file to fix a typo by changing "non existing" to "non-existing."test_register_routes
method in thewpRestFontCollectionsController.php
file by adding a missing "initialized" to "intialized."test_register_routes
method in thewpRestFontCollectionsController.php
file by adding a missing "initialized" to "intialized."test_register_routes
method in thewpRestFontCollectionsController.php
file by adding a missing "initialized" to "intialized."test_create_item_santize_font_family
totest_create_item_sanitize_font_family
in thewpRestFontFacesController.php
file to fix a typo.data_create_item_santize_font_family
todata_create_item_sanitize_font_family
in thewpRestFontFacesController.php
file to fix a typo.test_create_item_santize_font_family
totest_create_item_sanitize_font_family
in thewpRestFontFacesController.php
file to fix a typo.data_create_item_santize_font_family
todata_create_item_sanitize_font_family
in thewpRestFontFacesController.php
file to fix a typo.check_file_meta
method in thewpRestFontFacesController.php
file to more accurately reflect their purpose by changing$srcs
to$src_attributes
.check_file_meta
method in thewpRestFontFacesController.php
file to more accurately reflect their purpose by changing$srcs
to$src_attributes
.Testing Instructions
All PHPUnit tests and test code linting checks should still pass.
Testing Instructions for Keyboard