Changeset 48121 for trunk/tests/phpunit/tests/post/attachments.php
- Timestamp:
- 06/22/2020 05:24:34 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/attachments.php
r47122 r48121 467 467 // On Multisite, psd is not an allowed mime type by default. 468 468 if ( is_multisite() ) { 469 add_filter( 'upload_mimes', array( $this, ' whitelist_psd_mime_type' ), 10, 2 );469 add_filter( 'upload_mimes', array( $this, 'allow_psd_mime_type' ), 10, 2 ); 470 470 } 471 471 … … 482 482 483 483 if ( is_multisite() ) { 484 remove_filter( 'upload_mimes', array( $this, ' whitelist_psd_mime_type' ), 10, 2 );484 remove_filter( 'upload_mimes', array( $this, 'allow_psd_mime_type' ), 10, 2 ); 485 485 } 486 486 } … … 494 494 $this->assertFalse( $upload['error'] ); 495 495 496 add_filter( 'upload_mimes', array( $this, ' blacklist_jpg_mime_type' ) );497 498 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 499 500 remove_filter( 'upload_mimes', array( $this, ' blacklist_jpg_mime_type' ) );496 add_filter( 'upload_mimes', array( $this, 'disallow_jpg_mime_type' ) ); 497 498 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 499 500 remove_filter( 'upload_mimes', array( $this, 'disallow_jpg_mime_type' ) ); 501 501 502 502 $this->assertNotEmpty( $upload['error'] ); 503 503 } 504 504 505 public function whitelist_psd_mime_type( $mimes ) {505 public function allow_psd_mime_type( $mimes ) { 506 506 $mimes['psd'] = 'application/octet-stream'; 507 507 return $mimes; 508 508 } 509 509 510 public function blacklist_jpg_mime_type( $mimes ) {510 public function disallow_jpg_mime_type( $mimes ) { 511 511 unset( $mimes['jpg|jpeg|jpe'] ); 512 512 return $mimes;
Note: See TracChangeset
for help on using the changeset viewer.