Opened 7 weeks ago
Last modified 5 weeks ago
#65136 new enhancement
Unit Tests: Add tests for extract_from_markers() and stop empty values being returned
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | has-patch has-unit-tests |
| Focuses: | tests | Cc: |
Description
The function extract_from_markers() in src/wp-admin/includes/misc.php lacks unit tests. This PR adds tests to ensure it correctly extracts content between markers in a file, handling missing files, different markers, and comments.
Change History (4)
This ticket was mentioned in PR #11658 on WordPress/wordpress-develop by @pbearne.
7 weeks ago
#1
- Keywords has-patch has-unit-tests added
#2
@
7 weeks ago
- Keywords has-patch has-unit-tests removed
- Summary changed from Unit Tests: Add tests for extract_from_markers() to Unit Tests: Add tests for extract_from_markers() and stop empty values being returned
In testing, I found that empty lines where beeing return in the array of values
Add code to stop this
Note: See
TracTickets for help on using
tickets.
…sc.php
Reference: https://core.trac.wordpress.org/ticket/65136
This PR adds unit tests for the
extract_from_markers()function insrc/wp-admin/includes/misc.php.The tests cover:
.htaccessblock.Trac ticket: https://core.trac.wordpress.org/ticket/65136
## Use of AI Tools
AI assistance: Yes
Tool(s): Junie (JetBrains)
Model(s): gemini-3-flash-preview
Used for: Generating test cases, implementing
set_up/tear_downfor temporary file management, and validating extraction logic.