WordPress.org

Make WordPress Core

Changeset 40674


Ignore:
Timestamp:
05/15/17 22:58:03 (6 months ago)
Author:
westonruter
Message:

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

Amends [40640].
See #32417.

Location:
trunk/tests/phpunit
Files:
2 deleted
2 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. 
  • trunk/tests/phpunit/tests/widgets/media-widget.php

    r40640 r40674  
    129129     */ 
    130130    function test_is_attachment_with_mime_type() { 
     131 
     132        $test_image = '/tmp/canola.jpg'; 
     133        copy( DIR_TESTDATA . '/images/canola.jpg', $test_image ); 
    131134        $attachment_id = self::factory()->attachment->create_object( array( 
    132             'file' => DIR_TESTDATA . '/images/canola.jpg', 
     135            'file' => $test_image, 
    133136            'post_parent' => 0, 
    134137            'post_mime_type' => 'image/jpeg', 
    135138            'post_title' => 'Canola', 
    136139        ) ); 
    137         wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, DIR_TESTDATA . '/images/canola.jpg' ) ); 
     140        wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $test_image ) ); 
    138141        $widget = $this->get_mocked_class_instance(); 
    139142 
Note: See TracChangeset for help on using the changeset viewer.