diff --git a/tests/phpunit/tests/webfonts/wpThemeJsonWebfontsHandler.php b/tests/phpunit/tests/webfonts/wpThemeJsonWebfontsHandler.php deleted file mode 100644 index 7202417dde..0000000000 --- a/tests/phpunit/tests/webfonts/wpThemeJsonWebfontsHandler.php +++ /dev/null @@ -1,138 +0,0 @@ -orig_wp_styles = $wp_styles; - $wp_styles = null; - - $this->theme_root = realpath( DIR_TESTDATA . '/themedir1' ); - $this->orig_theme_dir = $GLOBALS['wp_theme_directories']; - - // /themes is necessary as theme.php functions assume /themes is the root if there is only one root. - $GLOBALS['wp_theme_directories'] = array( WP_CONTENT_DIR . '/themes', $this->theme_root ); - - $theme_root_callback = function () { - return $this->theme_root; - }; - - add_filter( 'theme_root', $theme_root_callback ); - add_filter( 'stylesheet_root', $theme_root_callback ); - add_filter( 'template_root', $theme_root_callback ); - - // Clear caches. - wp_clean_themes_cache(); - unset( $GLOBALS['wp_themes'] ); - } - - public function tear_down() { - global $wp_styles; - $wp_styles = $this->orig_wp_styles; - - // Restore the original theme directory setup. - $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir; - wp_clean_themes_cache(); - unset( $GLOBALS['wp_themes'] ); - - parent::tear_down(); - } - - /** - * @ticket 55567 - * @ticket 46370 - * @ticket 57430 - */ - public function test_font_face_generated_from_themejson() { - $this->setup_theme_and_test( 'webfonts-theme' ); - - $expected = << -@font-face{font-family:"Source Serif Pro";font-style:normal;font-weight:200 900;font-display:fallback;src:url('THEME_ROOT_URL/assets/fonts/SourceSerif4Variable-Roman.ttf.woff2') format('woff2');font-stretch:normal;}@font-face{font-family:"Source Serif Pro";font-style:italic;font-weight:200 900;font-display:fallback;src:url('THEME_ROOT_URL/assets/fonts/SourceSerif4Variable-Italic.ttf.woff2') format('woff2');font-stretch:normal;} - -EOF; - $expected = str_replace( 'THEME_ROOT_URL', get_stylesheet_directory_uri(), $expected ); - $expected = str_replace( "\r\n", "\n", $expected ); - - $this->assertStringContainsString( - $expected, - get_echo( 'wp_print_styles' ) - ); - } - - /** - * @dataProvider data_font_face_not_generated - * - * @ticket 55567 - * @ticket 46370 - */ - public function test_font_face_not_generated( $theme_name ) { - $this->setup_theme_and_test( $theme_name ); - - $actual = get_echo( 'wp_print_styles' ); - $this->assertStringNotContainsString( "