WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/25/2016 10:24:57 AM (5 years ago)
Author:
pento
Message:

Tests: Use a minimal theme for tests.

This functionality was originally added in [38858], using symlink() to put a link to the theme in WordPress' themes directory. Unfortunately, not all installs have write access to the themes directory, causing unit tests to fail.

The new method is to add the test theme directory to $wp_theme_directories, and fix the handful of tests that don't expect $wp_theme_directories to have multiple entries.

The test install/bootstrap routines now also check that WP_DEFAULT_THEME is defined, in case the tests are being run on a system that hasn't upgraded its' wp-tests-config.php.

See #31550.
Fixes #38457.

File:
1 edited

Legend:

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

    r38470 r38907  
    99$config_file_path = $argv[1];
    1010$multisite = ! empty( $argv[2] );
     11
     12// Set the theme to our special empty theme, to avoid interference from the current Twenty* theme.
     13if ( ! defined( 'WP_DEFAULT_THEME' ) ) {
     14    define( 'WP_DEFAULT_THEME', 'default' );
     15}
     16$wp_theme_directories = array( dirname( __FILE__ ) . '/../data/themedir1' );
    1117
    1218define( 'WP_INSTALLING', true );
Note: See TracChangeset for help on using the changeset viewer.