Make WordPress Core

Changeset 64033


Ignore:
Timestamp:
10/01/2026 06:09:30 PM (6 weeks ago)
Author:
lancewillett
Message:

Tests: Reuse the media fixture for attachment filesize tests.

Reuse the existing uploaded image in the attachment filesize fallback test instead of uploading an image and generating image sizes for each data set. Preserve all nine cases and 63 assertions against a real attachment file.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13905

Props sainathpoojary.
See #66074.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/media.php

    r63636 r64033  
    957957         */
    958958        public function test_wp_prepare_attachment_for_js_filesize_falls_back_to_the_file( $filesize ) {
    959                 $id = self::factory()->attachment->create_upload_object( DIR_TESTDATA . '/images/canola.jpg' );
     959                $id = self::$large_id;
    960960                $this->assertIsInt( $id );
    961961                $post = get_post( $id );
Note: See TracChangeset for help on using the changeset viewer.