Repository navigation
Conversation
Declare 9 data providers across tests/phpunit/tests/xmlrpc/ as public static for compatibility with newer PHPUnit versions. Preserve existing datasets and assertions. 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:
|
| * } | ||
| */ | ||
| public function data_comments_observe_post_permissions() { | ||
| public static function data_comments_observe_post_permissions() { |
There was a problem hiding this comment.
The other 8 providers in this PR declare an : array return type. Adding it here would keep them consistent:
| public static function data_comments_observe_post_permissions() { | |
| public static function data_comments_observe_post_permissions(): array { |
…s(). Keeps the return type declaration consistent with the other data providers in the XML-RPC test suite. See #66211.
There was a problem hiding this comment.
🟢 Approval recommended
The XML-RPC data-provider compatibility updates have no active review issues.
No open issues 🎉
What changed in this PR
Updates nine XML-RPC test data providers to public static for compatibility with newer PHPUnit versions, without changing datasets or assertions.
Changes:
- Makes five upload-file, one new-comment, and three addition-test providers static.
- Adds an
arrayreturn type to the new-comment provider.
| File | Description |
|---|---|
tests/phpunit/tests/xmlrpc/wp/uploadFile.php |
Makes five attachment-validation providers static. |
tests/phpunit/tests/xmlrpc/wp/newComment.php |
Makes the comment-permissions provider static and adds an array return type. |
tests/phpunit/tests/xmlrpc/demo/addTwoNumbers.php |
Makes three argument-validation providers static. |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
Datasets, assertions, and fixture lifetimes are preserved. The complete batch and unchanged trunk each passed randomized single-site and multisite runs: 542 tests and 1,268 assertions per mode, seed 66211. PHPCS passed all 12 changed files. Copilot reported no issues.
The earlier request for an array return type on the comment-permissions provider is addressed.
AI review · gpt-6
Declare 52 data providers in the dependency, term-data block binding, and XML-RPC tests as `public static` for compatibility with newer PHPUnit versions. Make three script helpers static and call them with `self::` from provider callbacks, preserving execution after test setup. Add the `array` return type to the comment-permissions provider. Preserve all datasets and assertions. Developed in: #14908, #14971, #14972 Props huzaifaalmesbah, rejaulalomkhan, therssoftware, mukesh27, shailu25. See #66211. git-svn-id: https://develop.svn.wordpress.org/trunk@65029 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #14972 landed in https://core.trac.wordpress.org/changeset/65029 |
Declare 52 data providers in the dependency, term-data block binding, and XML-RPC tests as `public static` for compatibility with newer PHPUnit versions. Make three script helpers static and call them with `self::` from provider callbacks, preserving execution after test setup. Add the `array` return type to the comment-permissions provider. Preserve all datasets and assertions. Developed in: WordPress/wordpress-develop#14908, WordPress/wordpress-develop#14971, WordPress/wordpress-develop#14972 Props huzaifaalmesbah, rejaulalomkhan, therssoftware, mukesh27, shailu25. See #66211. Built from https://develop.svn.wordpress.org/trunk@65029 git-svn-id: http://core.svn.wordpress.org/trunk@64179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Description
Trac ticket: #66211
Declares 9 data providers across
tests/phpunit/tests/xmlrpc/aspublic staticfor compatibility with newer PHPUnit versions (PHPUnit 10 deprecated non-public/non-static data providers, and PHPUnit 11 removed support for them).All datasets and assertions are preserved untouched.
Testing Instructions
Run PHPUnit test suite:
npm run test:php -- tests/phpunit/tests/xmlrpc/demo/addTwoNumbers.php tests/phpunit/tests/xmlrpc/wp/newComment.php tests/phpunit/tests/xmlrpc/wp/uploadFile.phpnpm run test:php -- -c tests/phpunit/multisite.xml tests/phpunit/tests/xmlrpc/demo/addTwoNumbers.php tests/phpunit/tests/xmlrpc/wp/newComment.php tests/phpunit/tests/xmlrpc/wp/uploadFile.phpnpm run test:php -- --group xmlrpc