Repository navigation
Conversation
…block. See #66532.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds unit tests for
render_block_core_site_logo(),register_block_core_site_logo()and the two settings insrc/wp-includes/blocks/site-logo.php, which were not referenced by any test. No behavior is changed. This is the first part of the ticket: the functions that keep thesite_logooption and thecustom_logotheme modification in sync are covered in a separate pull request.The new test class
tests/phpunit/tests/blocks/renderSiteLogo.php(19 tests) covers:<div>with theis-default-sizeclass, with a link to the home page (rel="home").isLinkfalse removes the link and keeps the image, and the target is not used without a link.linkTarget_blankaddstarget="_blank"and the "(Home link, opens in a new tab)" label, only when the link has thehomerel.widthattribute sets the width of the image and keeps the ratio for the height (and the source of the image), the default size class is not added with a width and is added for an empty width (null, zero, an empty string or'0'), and the size of an image without dimensions is not changed.site_logosetting (integer, in the REST API assite_logo) and thesite_iconsetting (integer, in the REST API) are registered, and the settings are hooked torest_api_init.Testing:
vendor/bin/phpunit --filter Tests_Blocks_RenderSiteLogovendor/bin/phpunit -c tests/phpunit/multisite.xml --filter Tests_Blocks_RenderSiteLogovendor/bin/phpcs tests/phpunit/tests/blocks/renderSiteLogo.phpI also temporarily broke the functions (each check of the width and of the image in the filter, the calculation of the height, the filter that is added and removed, the check of an empty logo, the removal of the link, each condition of the target, the label, the default size class, the wrapper, each argument of the two settings and their hooks, and the render callback) and confirmed that a new test fails for each one, except for two mutants that do not change the output: the check that the image is not empty (the checks of its dimensions already return the image) and the
isLinkcheck of the target (the link is already removed in that case).Trac ticket: https://core.trac.wordpress.org/ticket/66532
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5.5
Used for: Written with AI and manually reviewed by me.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.