Repository navigation
Tests: Add unit tests for wp_finalize_scraping_edited_file_errors() - #14479
shail-mehta wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused test-only changes have no identified blocking issues; tests were not executed.
No open issues 🎉
What changed in this PR
Adds dedicated PHPUnit coverage for wp_finalize_scraping_edited_file_errors() as part of the missing-coverage work in Trac #65819. No production code changes.
Changes:
- Tests the success payload and handling of non-fatal errors.
- Verifies the supplied scrape key appears in both output markers.
| File | Description |
|---|---|
| tests/phpunit/tests/load/wpFinalizeScrapingEditedFileErrors.php | Adds three isolated tests for output and scrape markers. |
Review effort: Balanced
|
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 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. |
mukeshpanchal27
left a comment
There was a problem hiding this comment.
The expected markers match wp_finalize_scraping_edited_file_errors(). One suggestion inline.
| /** | ||
| * @ticket 65819 | ||
| * | ||
| * @runInSeparateProcess |
There was a problem hiding this comment.
The separate process only gives each test an empty error_get_last(). Calling error_clear_last(); at the start of each test does the same in the normal process, so the three @runInSeparateProcess annotations could go. Also, test_uses_the_provided_scrape_key_in_markers() mostly repeats this test with a different key.
lancewillett
left a comment
There was a problem hiding this comment.
The output-marker assertions and error-state cleanup look correct.
The unit-tests audit is complete. This class passed independently, and the ten-PR batch passed randomized single-site and multisite runs (61 tests, 95 assertions each). PHPCS passed. I also reviewed the fresh Copilot feedback.
AI review · gpt-6
|
PR #14479 landed in https://core.trac.wordpress.org/changeset/64558 |
Add coverage for the output markers and nonfatal error handling in `wp_finalize_scraping_edited_file_errors()`. Developed in: #14479 Props shailu25, mukesh27. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@64558 602fd350-edb4-49c9-b593-d223f7449a82
Add coverage for the output markers and nonfatal error handling in `wp_finalize_scraping_edited_file_errors()`. Developed in: WordPress/wordpress-develop#14479 Props shailu25, mukesh27. See #65819. Built from https://develop.svn.wordpress.org/trunk@64558 git-svn-id: http://core.svn.wordpress.org/trunk@63708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What
Trac ticket: #65819
Adds unit tests for
wp_finalize_scraping_edited_file_errors()intests/phpunit/tests/load/wpFinalizeScrapingEditedFileErrors.php.Covers the success markers, non-fatal
error_get_last()values, and the scrape key in the output.Test-only change.
Why
This helper has had no dedicated PHPUnit coverage. Fits the #65819 missing-coverage track, and no open PR covers it.
How
truein the scrape markerstrueTesting instructions
Use of AI Tools