Repository navigation
Tests: Make data providers in tests/phpunit/tests/style-engine/ public and static - #15098
rejaulalomkhan wants to merge 1 commit into
Conversation
…c and 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:
|
lancewillett
left a comment
There was a problem hiding this comment.
The two providers return literal arrays and do not rely on test-instance state. Datasets and assertions are unchanged. PHPCS passed, and the combined three-PR batch passed randomized single-site and multisite runs: 219 tests and 1,311 assertions per mode, seed 66211.
AI review · gpt-6
Declare ten data providers in the style-engine, script-module, and load tests as `public static` for compatibility with newer PHPUnit versions. Add explicit `array` return types to the five load providers. Preserve all datasets and assertions. Developed in: #15098, #15102, #15153 Props rejaulalomkhan, therssoftware, mukesh27. See #66211. git-svn-id: https://develop.svn.wordpress.org/trunk@65027 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #15098 landed in https://core.trac.wordpress.org/changeset/65027 |
Declare ten data providers in the style-engine, script-module, and load tests as `public static` for compatibility with newer PHPUnit versions. Add explicit `array` return types to the five load providers. Preserve all datasets and assertions. Developed in: WordPress/wordpress-develop#15098, WordPress/wordpress-develop#15102, WordPress/wordpress-develop#15153 Props rejaulalomkhan, therssoftware, mukesh27. See #66211. Built from https://develop.svn.wordpress.org/trunk@65027 git-svn-id: http://core.svn.wordpress.org/trunk@64177 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.Files updated:
tests/phpunit/tests/style-engine/styleEngine.php:data_wp_style_engine_get_styles()->public static functiontests/phpunit/tests/style-engine/wpStyleEngineCssDeclarations.php:data_should_compile_css_declarations_to_css_declarations_string()->public static functionTesting Instructions
vendor/bin/phpunit --filter Tests_wpStyleEngine-> PASS (42 tests, 42 assertions).vendor/bin/phpunit tests/phpunit/tests/style-engine/wpStyleEngineCssDeclarations.php-> PASS (16 tests, 22 assertions).vendor/bin/phpcs tests/phpunit/tests/style-engine/-> PASS (0 errors, 0 warnings across all 5 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/style-engine/directory, converted data providers topublic static, and verified via PHPUnit/PHPCS. All changes inspected and verified locally before submission.