Skip to content

Tests: Replace deprecated $factory property access in wp_color_scheme_settings() tests - #15326

Closed
Soean wants to merge 1 commit into
WordPress:trunkfrom
Soean:code-quality/color-scheme-settings-factory-method
Closed

Soean wants to merge 1 commit into
WordPress:trunkfrom
Soean:code-quality/color-scheme-settings-factory-method

Conversation

@Soean

@Soean Soean commented Nov 1, 2026

Copy link
Copy Markdown
Member

Replaces the deprecated $this->factory property with self::factory() in the three wp_color_scheme_settings() tests.

These tests were added in [r65119] (Tests: Cover admin configuration helpers.), after the previous sweep in [r64358] replaced all other property accesses. This was the only remaining $this->factory property access in the test suite, flagged by Mago as deprecated-property.

Why this is safe

WP_UnitTestCase_Base::set_up() assigns $this->factory = static::factory(), so both return the same factory object. The test behavior does not change.

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


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.

…eme_settings()` tests.

Use `self::factory()` instead of the deprecated `$this->factory` property in the three `wp_color_scheme_settings()` tests, which were added after the previous replacement in [64358]. The factory object and test behavior stay the same.

See #65819.
@github-actions

github-actions Bot commented Nov 1, 2026

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 soean.

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 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are identified for the update to the supported test factory accessor.

No open issues 🎉

What changed in this PR

Updates the wp_color_scheme_settings() tests to use the supported factory accessor, completing the earlier cleanup of deprecated property access.

Changes:

  • Replaces $this->factory with self::factory() in all three tests.
  • Preserves user creation, assertions, and test behavior.
File Description
tests/​phpunit/​tests/​admin/​includes/​misc/​wpColorSchemeSettings.php Replaces deprecated factory property access in three color-scheme tests.

Review effort: Balanced

@lancewillett lancewillett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changed code against the implementation and existing coverage; no blocking issue found.

Validated with the related provider/factory patches on current trunk: 1,108 tests and 2,503 assertions in each of single-site and multisite, randomized seed 1101. The same two environment-dependent skips occurred before and after; no failures or errors.

Current-head CI and Copilot review checked.

AI review · gpt-6

wporg-sync pushed a commit that referenced this pull request Nov 1, 2026
Replace deprecated `$this->factory` property access with `self::factory()` in the `wp_color_scheme_settings()` tests.

Developed in: #15326

Props soean.
See #65819.


git-svn-id: https://develop.svn.wordpress.org/trunk@65163 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 1, 2026
Replace deprecated `$this->factory` property access with `self::factory()` in the `wp_color_scheme_settings()` tests.

Developed in: WordPress/wordpress-develop#15326

Props soean.
See #65819.

Built from https://develop.svn.wordpress.org/trunk@65163


git-svn-id: http://core.svn.wordpress.org/trunk@64312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@lancewillett

Copy link
Copy Markdown
Member

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.

3 participants