You appear to be a bot. Output may be restricted
Description
Usage
Tests_Media::test_wp_prepare_attachment_for_js_without_image_sizes();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/media.php
Lines:
1 to 28 of 28
function test_wp_prepare_attachment_for_js_without_image_sizes() { // Create the attachement post. $id = wp_insert_attachment( array( 'post_title' => 'Attachment Title', 'post_type' => 'attachment', 'post_parent' => 0, 'post_mime_type' => 'image/jpeg', 'guid' => 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/test-image.jpg', ) ); // Add attachment metadata without sizes. wp_update_attachment_metadata( $id, array( 'width' => 50, 'height' => 50, 'file' => 'test-image.jpg', ) ); $prepped = wp_prepare_attachment_for_js( get_post( $id ) ); $this->assertTrue( isset( $prepped['sizes'] ) ); }