Changeset 982 in tests for trunk/tests/functions.php
- Timestamp:
- 08/21/2012 10:19:28 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/functions.php
r976 r982 326 326 } 327 327 328 /** 329 * @ticket 21594 330 */ 328 331 function test_get_allowed_mime_types() { 329 332 $mimes = get_allowed_mime_types(); … … 332 335 $this->assertNotEmpty( $mimes ); 333 336 334 $callback = function( $mimes ) { 335 return array(); 336 }; 337 338 add_filter( 'upload_mimes', $callback ); 337 add_filter( 'upload_mimes', '__return_empty_array' ); 339 338 $mimes = get_allowed_mime_types(); 340 339 $this->assertInternalType( 'array', $mimes ); 341 340 $this->assertEmpty( $mimes ); 342 341 343 remove_filter( 'upload_mimes', $callback);342 remove_filter( 'upload_mimes', '__return_empty_array' ); 344 343 $mimes = get_allowed_mime_types(); 345 344 $this->assertInternalType( 'array', $mimes ); … … 347 346 } 348 347 348 /** 349 * @ticket 21594 350 */ 349 351 function test_wp_get_mime_types() { 350 352 $mimes = wp_get_mime_types(); … … 353 355 $this->assertNotEmpty( $mimes ); 354 356 355 $callback = function( $mimes ) { 356 return array(); 357 }; 358 359 add_filter( 'mime_types', $callback ); 357 add_filter( 'mime_types', '__return_empty_array' ); 360 358 $mimes = wp_get_mime_types(); 361 359 $this->assertInternalType( 'array', $mimes ); 362 360 $this->assertEmpty( $mimes ); 363 361 364 remove_filter( 'mime_types', $callback);362 remove_filter( 'mime_types', '__return_empty_array' ); 365 363 $mimes = wp_get_mime_types(); 366 364 $this->assertInternalType( 'array', $mimes ); … … 368 366 369 367 // upload_mimes shouldn't affect wp_get_mime_types() 370 add_filter( 'upload_mimes', $callback);368 add_filter( 'upload_mimes', '__return_empty_array' ); 371 369 $mimes = wp_get_mime_types(); 372 370 $this->assertInternalType( 'array', $mimes ); 373 371 $this->assertNotEmpty( $mimes ); 374 372 375 remove_filter( 'upload_mimes', $callback);373 remove_filter( 'upload_mimes', '__return_empty_array' ); 376 374 $mimes2 = wp_get_mime_types(); 377 375 $this->assertInternalType( 'array', $mimes2 );
Note: See TracChangeset
for help on using the changeset viewer.