Skip to content

Tests: Make data provider in realEscape.php static - #14800

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

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

Conversation

@shail-mehta

Copy link
Copy Markdown
Member

What

Trac ticket: #65819

Makes the data provider in tests/phpunit/tests/db/realEscape.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_real_escape_input_type_handling() to public static

Test-only; no production code changes.

Testing Instructions

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

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 no instance state, so this declaration-only change preserves its behavior and has no unresolved findings.

No open issues 🎉

What changed in this PR

Makes the database escaping test’s data provider static to align with current PHPUnit usage in WordPress Core.

Changes:

  • Declares data_real_escape_input_type_handling() as public static.
  • Leaves datasets, test linkage, and production code unchanged.
File Description
tests/​phpunit/​tests/​db/​realEscape.php Makes the self-contained 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