Make WordPress Core

Ticket #35987: 35987.diff

File 35987.diff, 770 bytes (added by borgesbruno, 10 years ago)

Patch, tests for wp_ext2type

  • tests/phpunit/tests/functions.php

     
    681681        }
    682682
    683683        /**
     684         * @dataProvider file_type_provider
     685         * @ticket 35987
     686         */
     687        function test_wp_ext2type($expected, $extension) {
     688                $this->assertEquals($expected, wp_ext2type($extension));
     689        }
     690
     691        function file_type_provider() {
     692                return array(
     693                        array('image', 'JPG'),
     694                        array('audio', 'mp3'),
     695                        array('text', 'txt'),
     696                        array('code', 'php'),
     697                        array('spreadsheet', 'xls'),
     698                        array('interactive', 'swf'),
     699                        array(null, 'unknown_format')                   
     700                );
     701        }
     702
     703        /**
    684704         * @ticket 33750
    685705         */
    686706        function test_the_date() {