Changeset 31670
- Timestamp:
- 03/07/2015 06:47:04 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/attachments.php
r31647 r31670 454 454 455 455 public function test_wp_attachment_is_default() { 456 // On Multisite, psd is not an allowed mime type by default. 457 if ( is_multisite() ) { 458 add_filter( 'upload_mimes', array( $this, 'whitelist_psd_mime_type' ), 10, 2 ); 459 } 460 456 461 $filename = DIR_TESTDATA . '/images/test-image.psd'; 457 462 $contents = file_get_contents( $filename ); … … 464 469 $this->assertFalse( wp_attachment_is( 'audio', $attachment_id ) ); 465 470 $this->assertFalse( wp_attachment_is( 'video', $attachment_id ) ); 471 472 if ( is_multisite() ) { 473 remove_filter( 'upload_mimes', array( $this, 'whitelist_psd_mime_type' ), 10, 2 ); 474 } 475 } 476 477 public function whitelist_psd_mime_type( $mimes ) { 478 $mimes['psd'] = 'application/octet-stream'; 479 return $mimes; 466 480 } 467 481 }
Note: See TracChangeset
for help on using the changeset viewer.