Repository navigation
Repair wp/5.9 branch Actions: Use assertString(Not)ContainsString() for string haystacks - #84416
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 |
9020ee7 to
0044c58
Compare
|
Size Change: 0 B Total Size: 1.11 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. |
0044c58 to
03278b5
Compare
ramonjd
left a comment
There was a problem hiding this comment.
| PR | Before (base PR) | After |
|---|---|---|
#84416 wp/5.9 (5 calls in class-block-editor-test.php, 6 in class-wp-rest-url-details-controller-test.php) |
#84415, PHP 8.0: 11 errors must be of type iterable, string given (3 block editor, 8 URL details) |
Top of stack #85103: all 10 PHP jobs pass; all 11 changed lines are still there |
03278b5 to
fd26041
Compare
…()` for string haystacks.
fd26041 to
9913f7e
Compare
Part of #82934.
What?
Replaces
assertContains()/assertNotContains()calls that use a string haystack withassertStringContainsString()/assertStringNotContainsString(). Test code only.phpunit/class-block-editor-test.php$after, the implodedwp-api-fetchinline script)phpunit/class-wp-rest-url-details-controller-test.php$data['title'])Why?
PHPUnit 9, which the
PHP 8.0andPHP 8.1legs ofunit-test.ymlrun, removed string-haystack support fromassertContains()/assertNotContains(), so these calls fail withTypeError: ... Argument #2 ($haystack) must be of type iterable, string given(3 block editor tests and 8 URL details test runs). ThePHP 7.4legs, on PHPUnit8.5.40, already warn about them.assertString*ContainsString()is available on the PHPUnit5.7and6.5legs throughyoast/phpunit-polyfills, which thewp-phpunit/wp-phpunit5.9test case uses.How?
The same problem
wp/6.0's #84284 fixes inWP_Webfonts_Test. That test doesn't exist on this branch, so this PR fixes the branch's own string-haystack calls. The two array-needleassertContains()calls in the URL details test are a different problem, fixed in #84418.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