Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/phpunit/tests/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand Down
Loading