Repository navigation
Tests: Make data providers in tests/phpunit/tests/ai-client/ public and static - #15103
rejaulalomkhan wants to merge 1 commit into
Conversation
…nd static See #66211.
|
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:
|
There was a problem hiding this comment.
🟢 Approval recommended
The PHPUnit data-provider compatibility update has no active review issues.
No open issues 🎉
What changed in this PR
This PR updates two AI client test data providers to meet modern PHPUnit requirements without changing their visibility or datasets.
Changes:
- Adds
statictodata_valid_request_timeout_overrides()anddata_invalid_request_timeouts(), both already public.
| File | Description |
|---|---|
tests/phpunit/tests/ai-client/wpAiClientPromptBuilder.php |
Makes both request-timeout data providers static. |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
Both timeout providers contain literal data and do not depend on the class fixtures or registry mock. Datasets and assertions are unchanged.
Baseline and patched runs each passed 194 tests / 499 assertions in randomized single-site and multisite runs, seed 66211. PHPCS passed; CI and Copilot are clear. No new tests or fixture cleanup are needed.
AI review · gpt-6
Declare the valid and invalid request-timeout data providers as `public static` for compatibility with newer PHPUnit versions. Preserve existing datasets and assertions. Developed in: #15103 Props rejaulalomkhan, mukesh27. See #66211. git-svn-id: https://develop.svn.wordpress.org/trunk@65034 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #15103 landed in https://core.trac.wordpress.org/changeset/65034 |
Declare the valid and invalid request-timeout data providers as `public static` for compatibility with newer PHPUnit versions. Preserve existing datasets and assertions. Developed in: WordPress/wordpress-develop#15103 Props rejaulalomkhan, mukesh27. See #66211. Built from https://develop.svn.wordpress.org/trunk@65034 git-svn-id: http://core.svn.wordpress.org/trunk@64184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Description
PHPUnit data providers that do not rely on test state or
$thisshould be declared aspublic staticto optimize test execution performance and comply with modern PHPUnit standards.Data providers updated in
tests/phpunit/tests/ai-client/wpAiClientPromptBuilder.php:data_valid_request_timeout_overrides()->public static functiondata_invalid_request_timeouts()->public static functionTesting Instructions
vendor/bin/phpunit --filter Tests_AI_Client_PromptBuilder-> PASS (194 tests, 499 assertions).vendor/bin/phpcs tests/phpunit/tests/ai-client/-> PASS (0 errors, 0 warnings across all 10 files).Trac ticket: https://core.trac.wordpress.org/ticket/66211
This Pull Request is for code review only. Please keep all other discussion to the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
Use of AI Tools
tests/phpunit/tests/ai-client/directory, converted data providers topublic static, and verified via PHPUnit/PHPCS. All changes inspected and verified locally before submission.