diff --git a/tests/phpunit/tests/functions.php b/tests/phpunit/tests/functions.php index 9939678366265..41ce50e90e575 100644 --- a/tests/phpunit/tests/functions.php +++ b/tests/phpunit/tests/functions.php @@ -1147,12 +1147,21 @@ public function test_wp_get_ext_types() { /** * @ticket 35987 + * @ticket 65819 + * @covers ::wp_ext2type */ public function test_wp_ext2type() { $extensions = wp_get_ext_types(); $this->assertNotEmpty( $extensions ); + // Literal mappings stay independent of the current registry contents. + $this->assertSame( 'image', wp_ext2type( 'jpg' ) ); + $this->assertSame( 'image', wp_ext2type( 'PNG' ) ); + $this->assertSame( 'audio', wp_ext2type( 'mp3' ) ); + $this->assertSame( 'video', wp_ext2type( 'mp4' ) ); + $this->assertSame( 'document', wp_ext2type( 'pdf' ) ); + foreach ( $extensions as $type => $extension_list ) { foreach ( $extension_list as $extension ) { $this->assertSame( $type, wp_ext2type( $extension ) );