Repository navigation
Repair wp/5.7 branch Actions: Make the Site Editor export test compatible with PHP 5.6 and 7.0 - #84793
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Size Change: 0 B Total Size: 1.37 MB ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
1b148f5 to
8799363
Compare
8799363 to
fcfc5a5
Compare
fcfc5a5 to
9b94121
Compare
9b94121 to
614dab8
Compare
Part of #82936.
What?
Two changes to
test_gutenberg_edit_site_export()inphpunit/class-edit-site-export-test.php, test code only:$zip->open( $filename )instead of$zip->open( $filename, ZipArchive::RDONLY )(line 34).$zip->numFilesinstead of$zip->count()(line 44), with aphpcs:ignoreforWordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase, sincenumFilesis a built-inZipArchiveproperty.Why?
ZipArchive::RDONLYwas added in PHP 7.4.3, andZipArchive::count()in PHP 7.2. ThePHP 5.6andPHP 7.0legs ofunit-test.ymlstop on the first of them:That is the
PHP 5.6output, where the undefined constant is a fatal error that ends the whole run. OnPHP 7.0it is anError(Undefined class constant 'RDONLY') that fails this one test. With the constant removed, both versions would fail next oncount().The test only reads the zip the plugin creates, so the default mode, which opens an existing file for reading, checks the same thing.
numFileshas been available since PHP 5.2 and holds the valuecount()returns. The plugin's export code is unchanged.How?
The
phpcs:ignoreis needed because this branch's ruleset otherwise reportsObject property "$numFiles" is not in valid snake_case format.wp/5.9and newer don't have this test: it was removed in e01295f (#36908).Use of AI Tools
This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.
🤖 Generated with Claude Code