Changeset 65539
- Timestamp:
- 11/17/2026 01:38:09 AM (36 hours ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 2 edited
-
fonts/font-library/wpRestFontFacesController.php (modified) (2 diffs)
-
functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/fonts/font-library/wpRestFontFacesController.php
r65319 r65539 464 464 public function test_create_item_with_multiple_font_files() { 465 465 wp_set_current_user( self::$admin_id ); 466 467 $formats = array( 'ttf', 'otf', 'woff', 'woff2' ); 468 469 /* 470 * Some libmagic versions cannot detect TrueType fonts and report them as 471 * application/octet-stream, which causes the upload to be rejected. 472 * 473 * @link https://github.com/php/php-src/issues/25051 474 */ 475 if ( 'application/octet-stream' === finfo_file( finfo_open( FILEINFO_MIME_TYPE ), DIR_TESTDATA . '/fonts/OpenSans-Regular.ttf' ) ) { 476 $formats = array_diff( $formats, array( 'ttf' ) ); 477 } 478 479 $files = $this->setup_font_file_upload( $formats ); 466 $files = $this->setup_font_file_upload( array( 'ttf', 'otf', 'woff', 'woff2' ) ); 480 467 481 468 $request = new WP_REST_Request( 'POST', '/wp/v2/font-families/' . self::$font_family_id . '/font-faces' ); … … 502 489 503 490 $settings = $data['font_face_settings']; 504 $this->assertCount( count( $files ), $settings['src'], 'There should be one item in the font_face_settings::src data for each uploaded file.' );491 $this->assertCount( 4, $settings['src'], 'There should be 4 items in the font_face_settings::src data.' ); 505 492 } 506 493 -
trunk/tests/phpunit/tests/functions.php
r65340 r65539 1911 1911 $filename = 'OpenSans-Regular.ttf'; 1912 1912 1913 $detected_type = finfo_file( finfo_open( FILEINFO_MIME_TYPE ), $file );1914 if ( ! in_array( $detected_type, array( 'font/ttf', 'font/sfnt' ), true ) ) {1915 $this->markTestSkipped( "This version of libmagic detects TrueType fonts as {$detected_type}." );1916 }1917 1918 1913 $filter = static function ( $mimes ) use ( $mime_type ) { 1919 1914 $mimes['ttf'] = $mime_type;
Note:
See TracChangeset
for help on using the changeset viewer.