- Timestamp:
- 05/15/2017 10:58:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/widgets/media-image-widget.php
r40640 r40674 311 311 function test_render_media() { 312 312 $widget = new WP_Widget_Media_Image(); 313 314 $test_image = '/tmp/canola.jpg'; 315 copy( DIR_TESTDATA . '/images/canola.jpg', $test_image ); 313 316 $attachment_id = self::factory()->attachment->create_object( array( 314 'file' => DIR_TESTDATA . '/images/canola.jpg',317 'file' => $test_image, 315 318 'post_parent' => 0, 316 319 'post_mime_type' => 'image/jpeg', 317 320 'post_title' => 'Canola', 318 321 ) ); 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 ) ); 320 323 321 324 // Should be empty when there is no attachment_id.
Note: See TracChangeset
for help on using the changeset viewer.