mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-02 08:10:04 +00:00
Tests: Use a minimal theme for tests.
New default themes require workarounds being added to several unit tests, as they often alter default WordPress behaviour. To avoid ongoing maintenance issues, this change switches to a minimal theme when running tests. This change also removes the old workarounds for default themes. Fixes #31550. git-svn-id: https://develop.svn.wordpress.org/trunk@38858 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -161,3 +161,21 @@ function _upload_dir_https( $uploads ) {
|
||||
|
||||
return $uploads;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper functions to link and unlink the empty default theme into the WordPress install
|
||||
*/
|
||||
function _symlink_default_theme() {
|
||||
_unlink_default_theme();
|
||||
symlink( DIR_TESTDATA . '/themedir1/default', ABSPATH . '/wp-content/themes/default' );
|
||||
}
|
||||
|
||||
function _unlink_default_theme() {
|
||||
if ( file_exists( ABSPATH . '/wp-content/themes/default' ) ) {
|
||||
unlink( ABSPATH . '/wp-content/themes/default' );
|
||||
}
|
||||
}
|
||||
// Only unlink when we're in the main process.
|
||||
if ( 'phpunit' === substr( $GLOBALS['argv'][0], -7 ) ) {
|
||||
register_shutdown_function( '_unlink_default_theme' );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user