Index: tests/phpunit/tests/functions.php
===================================================================
--- tests/phpunit/tests/functions.php	(revisão 37625)
+++ tests/phpunit/tests/functions.php	(cópia de trabalho)
@@ -887,4 +887,30 @@
 
 		$this->assertNull( wp_ext2type( 'unknown_format' ) );
 	}
+
+	/**
+	 * @dataProvider files_provider
+	 */
+	public function test_wp_check_filetype( $actual, $expected, $mimes = null ) {
+		$result = wp_check_filetype( $actual, $mimes );
+
+		$this->assertInternalType( 'array', $result, 'The return must be an array' );
+		$this->assertArrayHasKey( 'ext', $result, "The return array must contains the 'ext' key" );
+		$this->assertArrayHasKey( 'type', $result, "The return array must contains the 'type' key" );
+		$this->assertEquals( $expected['ext'], $result['ext'] );
+		$this->assertEquals( $expected['type'], $result['type'] );
+	}
+
+	function files_provider() {
+		return array(
+			array( '/var/www/html/image.jpg', array( 'ext' => 'jpg', 'type' => 'image/jpeg' ), null ),
+			array( '/home/foo/file.csv', array( 'ext' => 'csv', 'type' => 'text/csv' ), null ),
+			array(
+				'/home/foo/flash_pix_file.fpx',
+				array( 'ext' => 'fpx', 'type' => 'image/vnd.fpx' ),
+				array( 'fpx' => 'image/vnd.fpx', 'g' => 'text/plain' ),
+			),
+			array( 'win_help_file.hlp', array( 'ext' => false, 'type' => false ), null ),
+		);
+	}
 }
