| @@ 363-378 (lines=16) @@ | ||
| 360 | /** |
|
| 361 | * @ticket 21594 |
|
| 362 | */ |
|
| 363 | function test_get_allowed_mime_types() |
|
| 364 | { |
|
| 365 | $mimes = get_allowed_mime_types(); |
|
| 366 | ||
| 367 | $this->assertInternalType('array', $mimes); |
|
| 368 | $this->assertNotEmpty($mimes); |
|
| 369 | ||
| 370 | add_filter('upload_mimes', '__return_empty_array'); |
|
| 371 | $mimes = get_allowed_mime_types(); |
|
| 372 | $this->assertInternalType('array', $mimes); |
|
| 373 | $this->assertEmpty($mimes); |
|
| 374 | ||
| 375 | remove_filter('upload_mimes', '__return_empty_array'); |
|
| 376 | $mimes = get_allowed_mime_types(); |
|
| 377 | $this->assertInternalType('array', $mimes); |
|
| 378 | $this->assertNotEmpty($mimes); |
|
| 379 | } |
|
| 380 | ||
| 381 | /** |
|
| @@ 874-888 (lines=15) @@ | ||
| 871 | /** |
|
| 872 | * @ticket 35987 |
|
| 873 | */ |
|
| 874 | public function test_wp_get_ext_types() |
|
| 875 | { |
|
| 876 | $extensions = wp_get_ext_types(); |
|
| 877 | ||
| 878 | $this->assertInternalType('array', $extensions); |
|
| 879 | $this->assertNotEmpty($extensions); |
|
| 880 | ||
| 881 | add_filter('ext2type', '__return_empty_array'); |
|
| 882 | $extensions = wp_get_ext_types(); |
|
| 883 | $this->assertSame(array(), $extensions); |
|
| 884 | ||
| 885 | remove_filter('ext2type', '__return_empty_array'); |
|
| 886 | $extensions = wp_get_ext_types(); |
|
| 887 | $this->assertInternalType('array', $extensions); |
|
| 888 | $this->assertNotEmpty($extensions); |
|
| 889 | } |
|
| 890 | ||
| 891 | /** |
|