Repository navigation
Repair wp/5.8 branch Actions: Make the Site Editor export test compatible with PHP 5.6 and 7.0 - #84457
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 |
4c9ca51 to
ff58fee
Compare
|
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. |
ff58fee to
4ab1556
Compare
4ab1556 to
c0268de
Compare
c0268de to
c895ccc
Compare
c895ccc to
84a8858
Compare
84a8858 to
deab987
Compare
Part of #82935.
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 39).$zip->numFilesinstead of$zip->count()(line 49), 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