Make WordPress Core


Ignore:
Timestamp:
11/12/2026 03:30:19 AM (104 minutes ago)
Author:
lancewillett
Message:

Tests: Limit upload directory isolation to the Core test suite.

Preserve default upload paths for plugin and theme test suites. Only define and clean the dedicated uploads directory when WP_RUN_CORE_TESTS is enabled.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15914

Props peterwilsoncc.
See #63532.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/bootstrap.php

    r65385 r65409  
    251251
    252252/*
     253 * Isolate uploads in a dedicated directory when running the core test suite only,
     254 * so that plugins and themes using the test suite keep the default uploads location.
     255 *
    253256 * Tests that cover the upload_path and upload_url_path options run in a separate process
    254257 * with WP_TESTS_SKIP_UPLOADS_CONSTANT set, as UPLOADS overrides those options.
    255258 */
    256 if ( ! defined( 'UPLOADS' ) && '1' !== getenv( 'WP_TESTS_SKIP_UPLOADS_CONSTANT' ) ) {
     259if (
     260        defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS
     261        && ! defined( 'UPLOADS' )
     262        && '1' !== getenv( 'WP_TESTS_SKIP_UPLOADS_CONSTANT' )
     263) {
    257264        define( 'UPLOADS', 'wp-content/test-suite-uploads' );
    258265
Note: See TracChangeset for help on using the changeset viewer.