Skip to content

Tests: Make data provider in dependencies.php static - #14802

Draft
shail-mehta wants to merge 1 commit into
WordPress:trunkfrom
shail-mehta:tests/65819-static-data-provider-dependencies
Draft

shail-mehta wants to merge 1 commit into
WordPress:trunkfrom
shail-mehta:tests/65819-static-data-provider-dependencies

Conversation

@shail-mehta

Copy link
Copy Markdown
Member

What

Trac ticket: #65819

Makes the data provider in tests/phpunit/tests/dependencies.php static.

Why

PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.

How

  • Convert data_provider_get_etag() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Dependencies
  2. npm run test:php -- --filter Tests_Dependencies -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Dependencies --order-by=random
  4. npm run test:php -- --group dependencies

Use of AI Tools

  • Cursor

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

The provider uses only literal data and remains compatible with both existing test consumers.

No open issues 🎉

What changed in this PR

Makes the dependency test data provider static to align with PHPUnit expectations. This is a test-only change with no production impact.

Changes:

  • Declares data_provider_get_etag() as public static, leaving its data unchanged.
File Description
tests/​phpunit/​tests/​dependencies.php Makes the ETag data provider static.

Review effort: Balanced

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.

2 participants