diff --git a/tests/phpunit/tests/fonts/font-library/wpRestFontFacesController.php b/tests/phpunit/tests/fonts/font-library/wpRestFontFacesController.php index 2a2026ccf2458..05af011f5cf0a 100644 --- a/tests/phpunit/tests/fonts/font-library/wpRestFontFacesController.php +++ b/tests/phpunit/tests/fonts/font-library/wpRestFontFacesController.php @@ -463,20 +463,7 @@ function ( $font_dir ) { */ public function test_create_item_with_multiple_font_files() { wp_set_current_user( self::$admin_id ); - - $formats = array( 'ttf', 'otf', 'woff', 'woff2' ); - - /* - * Some libmagic versions cannot detect TrueType fonts and report them as - * application/octet-stream, which causes the upload to be rejected. - * - * @link https://github.com/php/php-src/issues/25051 - */ - if ( 'application/octet-stream' === finfo_file( finfo_open( FILEINFO_MIME_TYPE ), DIR_TESTDATA . '/fonts/OpenSans-Regular.ttf' ) ) { - $formats = array_diff( $formats, array( 'ttf' ) ); - } - - $files = $this->setup_font_file_upload( $formats ); + $files = $this->setup_font_file_upload( array( 'ttf', 'otf', 'woff', 'woff2' ) ); $request = new WP_REST_Request( 'POST', '/wp/v2/font-families/' . self::$font_family_id . '/font-faces' ); $request->set_param( 'theme_json_version', WP_REST_Font_Faces_Controller::LATEST_THEME_JSON_VERSION_SUPPORTED ); @@ -501,7 +488,7 @@ public function test_create_item_with_multiple_font_files() { $this->check_file_meta( $data['id'], $data['font_face_settings']['src'] ); $settings = $data['font_face_settings']; - $this->assertCount( count( $files ), $settings['src'], 'There should be one item in the font_face_settings::src data for each uploaded file.' ); + $this->assertCount( 4, $settings['src'], 'There should be 4 items in the font_face_settings::src data.' ); } /** diff --git a/tests/phpunit/tests/functions.php b/tests/phpunit/tests/functions.php index 9e04db504de13..51419799dbd16 100644 --- a/tests/phpunit/tests/functions.php +++ b/tests/phpunit/tests/functions.php @@ -1910,11 +1910,6 @@ public function test_wp_check_filetype_and_ext_accepts_either_ttf_mime_type( $mi $file = DIR_TESTDATA . '/fonts/OpenSans-Regular.ttf'; $filename = 'OpenSans-Regular.ttf'; - $detected_type = finfo_file( finfo_open( FILEINFO_MIME_TYPE ), $file ); - if ( ! in_array( $detected_type, array( 'font/ttf', 'font/sfnt' ), true ) ) { - $this->markTestSkipped( "This version of libmagic detects TrueType fonts as {$detected_type}." ); - } - $filter = static function ( $mimes ) use ( $mime_type ) { $mimes['ttf'] = $mime_type; return $mimes;