mirrored from git://develop.git.wordpress.org/
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the mimetypes per php version private
- Loading branch information
1 parent
2613c74
commit 2d1d9b2
Showing
3 changed files
with
58 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 0 additions & 89 deletions
89
tests/phpunit/tests/fonts/font-library/wpFontLibrary/getMimeTypes.php
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
tests/phpunit/tests/fonts/font-library/wpFontLibrary/setAllowedMimeTypes.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/** | ||
* Test WP_Font_Library::set_allowed_mime_types(). | ||
* | ||
* @package WordPress | ||
* @subpackage Font Library | ||
* | ||
* @group fonts | ||
* @group font-library | ||
* @group toto | ||
* | ||
* @covers WP_Font_Library::set_allowed_mime_types | ||
*/ | ||
class Tests_Fonts_WpFontLibrary_SetAllowedMimeTypes extends WP_Font_Library_UnitTestCase { | ||
|
||
public function test_should_supply_correct_mime_type_for_php_version() { | ||
$allowed_mime_types_per_php_version = array( | ||
0 => array( | ||
'otf' => 'application/vnd.ms-opentype', | ||
'ttf' => 'application/x-font-ttf', | ||
'woff' => 'application/font-woff', | ||
'woff2' => 'application/font-woff2', | ||
), | ||
70300 => array( | ||
'otf' => 'application/vnd.ms-opentype', | ||
'ttf' => 'application/font-sfnt', | ||
'woff' => 'application/font-woff', | ||
'woff2' => 'application/font-woff2', | ||
), | ||
70400 => array( | ||
'otf' => 'application/vnd.ms-opentype', | ||
'ttf' => 'font/sfnt', | ||
'woff' => 'application/font-woff', | ||
'woff2' => 'application/font-woff2', | ||
), | ||
80100 => array( | ||
'otf' => 'application/vnd.ms-opentype', | ||
'ttf' => 'font/sfnt', | ||
'woff' => 'font/woff', | ||
'woff2' => 'font/woff2', | ||
), | ||
); | ||
foreach ( $allowed_mime_types_per_php_version as $php_version => $current_mime_types ) { | ||
if ( $php_version < PHP_VERSION_ID ) { | ||
$expected = $current_mime_types; | ||
} | ||
} | ||
|
||
$mimes = WP_Font_Library::set_allowed_mime_types( array() ); | ||
$this->assertSame( $expected, $mimes ); | ||
} | ||
} |