Changeset 54769 for trunk/tests/phpunit/tests/blocks/editor.php
- Timestamp:
- 11/09/2022 12:28:33 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/editor.php
r54162 r54769 300 300 $this->assertIsInt( $settings['maxUploadFileSize'] ); 301 301 $this->assertTrue( $settings['__unstableGalleryWithImageBlocks'] ); 302 } 303 304 /** 305 * @ticket 56815 306 */ 307 public function test_get_default_block_editor_settings_max_upload_file_size() { 308 // Force the return value of wp_max_upload_size() to be 500. 309 add_filter( 310 'upload_size_limit', 311 function() { 312 return 500; 313 } 314 ); 315 316 // Expect 0 when user is not allowed to upload (as wp_max_upload_size() should not be called). 317 $settings = get_default_block_editor_settings(); 318 $this->assertSame( 0, $settings['maxUploadFileSize'] ); 319 320 // Set up an administrator, as they can upload files. 321 $administrator = self::factory()->user->create( array( 'role' => 'administrator' ) ); 322 wp_set_current_user( $administrator ); 323 324 // Expect the above 500 as the user is now allowed to upload. 325 $settings = get_default_block_editor_settings(); 326 $this->assertSame( 500, $settings['maxUploadFileSize'] ); 302 327 } 303 328
Note: See TracChangeset
for help on using the changeset viewer.