[wp-trac] [WordPress Trac] #63532: Unit Testing: Checking if images already exists before starting tests
WordPress Trac
noreply at wordpress.org
Fri Apr 3 06:39:36 UTC 2026
#63532: Unit Testing: Checking if images already exists before starting tests
-------------------------------------------------+-------------------------
Reporter: SirLouen | Owner: (none)
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: Future
| Release
Component: Media | Version:
Severity: normal | Resolution:
Keywords: has-unit-tests has-test-info needs- | Focuses: tests
patch |
-------------------------------------------------+-------------------------
Comment (by sukhendu2002):
I tested the UPLOADS constant approach in bootstrap.php, and it does solve
the collision by isolating test uploads in a disposable directory.
The main thing I found is that this change affects more of the test suite
than it first appears, because it changes the base URL returned by
wp_upload_dir() globally. As a result, several media tests with hardcoded
wp-content/uploads URLs start failing and need to be updated to use
dynamic upload URLs instead.
So the approach looks valid, but the patch likely needs broader test
updates alongside it. Discussion and alternative ideas are welcome.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63532#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list