Make WordPress Core


Ignore:
Timestamp:
05/15/2017 10:58:03 PM (9 years ago)
Author:
westonruter
Message:

Widgets: Remove image sizes generated during media widget phpunit tests from being version controlled.

Amends [40640].
See #32417.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/widgets/media-image-widget.php

    r40640 r40674  
    311311        function test_render_media() {
    312312                $widget = new WP_Widget_Media_Image();
     313
     314                $test_image = '/tmp/canola.jpg';
     315                copy( DIR_TESTDATA . '/images/canola.jpg', $test_image );
    313316                $attachment_id = self::factory()->attachment->create_object( array(
    314                         'file' => DIR_TESTDATA . '/images/canola.jpg',
     317                        'file' => $test_image,
    315318                        'post_parent' => 0,
    316319                        'post_mime_type' => 'image/jpeg',
    317320                        'post_title' => 'Canola',
    318321                ) );
    319                 wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, DIR_TESTDATA . '/images/canola.jpg' ) );
     322                wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $test_image ) );
    320323
    321324                // Should be empty when there is no attachment_id.
Note: See TracChangeset for help on using the changeset viewer.