Repository navigation
Tests: Add coverage for _wp_rest_get_debug_backtrace_caller(). - #1
Merged
ilclaudio merged 1 commit intoOct 19, 2026
Conversation
Covers the caller reported for a named function, an instance method, a static method, a closure, and a call from a file's global scope; that the innermost frame inside WP_CONTENT_DIR is used; that calls from outside WP_CONTENT_DIR report nothing; and that a sibling directory sharing the content directory's name prefix, such as wp-content-backup, is not treated as part of it. Each test calls the function from a fixture file written inside WP_CONTENT_DIR, which is removed afterwards. See #64260.
|
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. |
ilclaudio
merged commit Oct 19, 2026
20e8b97
into
ilclaudio:fix/64260-rest-doing-it-wrong-log
4 checks passed
Owner
|
Merge done |
ilclaudio
pushed a commit
that referenced
this pull request
Oct 19, 2026
…t is not set.
This resolves an error if `mysqli_num_fields()` is called before a successful SELECT-type query is performed:
{{{
mysqli_num_fields(): Argument #1 ($result) must be of type mysqli_result, false given
}}}
Developed in WordPress#13099.
Follow-up to r21472.
Props joehorntw, akshat2802, mukesh27, rejaulalomkhan, SergeyBiryukov.
Fixes #64130.
git-svn-id: https://develop.svn.wordpress.org/trunk@64458 602fd350-edb4-49c9-b593-d223f7449a82
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @ilclaudio! This adds PHPUnit coverage for the new
_wp_rest_get_debug_backtrace_caller()helper in your PR WordPress#10537, so it can be merged straight into your branch. It only adds one test file and does not change your code.Trac ticket: https://core.trac.wordpress.org/ticket/64260
What is covered
tests/phpunit/tests/rest-api/wpRestGetDebugBacktraceCaller.php, 8 tests:called from func() in /path on line N.Class->method()andClass::method().(anonymous function).require/include.WP_CONTENT_DIRis reported when several are.WP_CONTENT_DIRreturns an empty string.wp-content-backupis not treated as part ofwp-content(thetrailingslashit()fix from review).Each test calls the helper from a fixture file written inside
WP_CONTENT_DIR, the way a plugin would, and removes it afterwards.Testing
0f1ef94359). PHPCS is clean.trailingslashit(), the closure label, theinclude/requirecheck, and the class prefix.restapigroup has the same failures with and without this file, so it does not affect other tests.The
error_log()lines in the three handlers are not covered: the test suite does not defineWP_DEBUG_LOG, so it is alwaysfalsethere and that path cannot be reached without a separate process.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Drafting the test cases and running the checks. I reviewed the tests and the results.