mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 05:04:31 +00:00
Themes: Ensure the theme roots cache is cleared when registering a theme directory.
Props soulseekah, johnbillion Fixes #43228 git-svn-id: https://develop.svn.wordpress.org/trunk@42788 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -293,4 +293,24 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase {
|
||||
rmdir( WP_CONTENT_DIR . '/themes/foo' );
|
||||
rmdir( WP_CONTENT_DIR . '/themes/foo-themes' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 43228
|
||||
*/
|
||||
function test_theme_dir_caches() {
|
||||
@mkdir( WP_CONTENT_DIR . '/themes/foo' );
|
||||
@mkdir( WP_CONTENT_DIR . '/themes/foo/bar' );
|
||||
|
||||
$old_roots = get_theme_roots();
|
||||
|
||||
register_theme_directory( WP_CONTENT_DIR . '/themes/foo' );
|
||||
|
||||
$new_roots = get_theme_roots();
|
||||
|
||||
rmdir( WP_CONTENT_DIR . '/themes/foo/bar' );
|
||||
rmdir( WP_CONTENT_DIR . '/themes/foo' );
|
||||
|
||||
$this->assertNotEquals( $new_roots, $old_roots );
|
||||
$this->assertArrayHasKey( 'foo', $new_roots );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user