Changeset 40674
- Timestamp:
- 05/15/2017 10:58:03 PM (8 years ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 2 deleted
- 2 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. -
trunk/tests/phpunit/tests/widgets/media-widget.php
r40640 r40674 129 129 */ 130 130 function test_is_attachment_with_mime_type() { 131 132 $test_image = '/tmp/canola.jpg'; 133 copy( DIR_TESTDATA . '/images/canola.jpg', $test_image ); 131 134 $attachment_id = self::factory()->attachment->create_object( array( 132 'file' => DIR_TESTDATA . '/images/canola.jpg',135 'file' => $test_image, 133 136 'post_parent' => 0, 134 137 'post_mime_type' => 'image/jpeg', 135 138 'post_title' => 'Canola', 136 139 ) ); 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 ) ); 138 141 $widget = $this->get_mocked_class_instance(); 139 142
Note: See TracChangeset
for help on using the changeset viewer.