Skip to content

Tests: Remove a stale style assertion from the customize widgets preview test. - #16148

Open
ekamran wants to merge 1 commit into
WordPress:trunkfrom
ekamran:shifteq/66755-customize-widgets-style-assertion
Open

ekamran wants to merge 1 commit into
WordPress:trunkfrom
ekamran:shifteq/66755-customize-widgets-style-assertion

Conversation

@ekamran

@ekamran ekamran commented Nov 21, 2026

Copy link
Copy Markdown

Tests_WP_Customize_Widgets::test_customize_preview_enqueue() checks that WP_Customize_Widgets::customize_preview_enqueue() enqueues the customize-preview style. Since r39951 (#39498) that style is enqueued by WP_Customize_Manager::customize_preview_init(), and the widgets method only enqueues the customize-preview-widgets script. The assertion stayed, so it depends on pre-existing global $wp_styles state and fails when the test runs alone.

Trac ticket: https://core.trac.wordpress.org/ticket/66755

What changes

  • The customize-preview style assertion is removed. The script and dependency assertions stay.

Testing

Locally with PHP 8.4.27, MySQL 9.7.4 and PHPUnit 9.6.39 on single site and multisite:

  • vendor/bin/phpunit --filter 'Tests_WP_Customize_Widgets::test_customize_preview_enqueue$': 1 failure on trunk ("Failed asserting that false is true." at widgets.php:785), OK (1 test, 10 assertions) with this change. Same with -c tests/phpunit/multisite.xml.
  • vendor/bin/phpunit --filter 'Tests_WP_Customize_Widgets::': OK on trunk (28 tests, 410 assertions; the class order masks the stale assertion) and with this change (28 tests, 409 assertions).
  • Found in a full-suite run with -c tests/phpunit/multisite.xml --testsuite default --order-by=random --random-order-seed=202.
  • PHPCS reports nothing on the changed file.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code and Codex
Used for: Investigation, code, local testing and PR wording. I reviewed the reasoning, the code and the test results, and I take responsibility for the contribution.


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.

@github-actions

Copy link
Copy Markdown

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:

Props ekamran.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant