WordPress.org

Make WordPress Core

Ticket #43228: 43228.tests.diff

File 43228.tests.diff, 799 bytes (added by soulseekah, 3 years ago)

The tests.

  • tests/phpunit/tests/theme/themeDir.php

    diff --git tests/phpunit/tests/theme/themeDir.php tests/phpunit/tests/theme/themeDir.php
    index 2cab375..5136c83 100644
    class Tests_Theme_ThemeDir extends WP_UnitTestCase { 
    293293                rmdir( WP_CONTENT_DIR . '/themes/foo' );
    294294                rmdir( WP_CONTENT_DIR . '/themes/foo-themes' );
    295295        }
     296
     297        /**
     298         * @ticket 43228
     299         */
     300        function test_theme_dir_caches() {
     301                @mkdir( WP_CONTENT_DIR . '/themes/foo' );
     302                @mkdir( WP_CONTENT_DIR . '/themes/foo/bar' );
     303
     304                $roots = get_theme_roots();
     305
     306                register_theme_directory( WP_CONTENT_DIR . '/themes/foo' );
     307
     308                $this->assertNotEquals( get_theme_roots(), $roots );
     309
     310                rmdir( WP_CONTENT_DIR . '/themes/foo/bar' );
     311                rmdir( WP_CONTENT_DIR . '/themes/foo' );
     312        }
    296313}