Changeset 48329 for trunk/tests/phpunit/tests/media.php
- Timestamp:
- 07/05/2020 11:30:36 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/media.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/media.php
r48275 r48329 2809 2809 ); 2810 2810 } 2811 2812 /** 2813 * @ticket 50543 2814 */ 2815 function test_wp_image_file_matches_image_meta() { 2816 $image_meta = wp_get_attachment_metadata( self::$large_id ); 2817 $image_src_full = wp_get_attachment_image_url( self::$large_id, 'full' ); 2818 $image_src_medium = wp_get_attachment_image_url( self::$large_id, 'medium' ); 2819 2820 $this->assertTrue( wp_image_file_matches_image_meta( $image_src_full, $image_meta ) ); 2821 $this->assertTrue( wp_image_file_matches_image_meta( $image_src_medium, $image_meta ) ); 2822 } 2823 2824 /** 2825 * @ticket 50543 2826 */ 2827 function test_wp_image_file_matches_image_meta_no_subsizes() { 2828 $image_meta = wp_get_attachment_metadata( self::$large_id ); 2829 $image_src = wp_get_attachment_image_url( self::$large_id, 'full' ); 2830 $image_meta['sizes'] = array(); 2831 2832 $this->assertTrue( wp_image_file_matches_image_meta( $image_src, $image_meta ) ); 2833 } 2834 2835 /** 2836 * @ticket 50543 2837 */ 2838 function test_wp_image_file_matches_image_meta_invalid_meta() { 2839 $image_meta = ''; // Attachment is not an image. 2840 $image_src = $this->img_url; 2841 2842 $this->assertFalse( wp_image_file_matches_image_meta( $image_src, $image_meta ) ); 2843 } 2844 2845 /** 2846 * @ticket 50543 2847 */ 2848 function test_wp_image_file_matches_image_meta_different_meta() { 2849 $image_meta = wp_get_attachment_metadata( self::$large_id ); 2850 $image_src = $this->img_url; // Different image. 2851 2852 $this->assertFalse( wp_image_file_matches_image_meta( $image_src, $image_meta ) ); 2853 } 2811 2854 } 2812 2855
Note: See TracChangeset
for help on using the changeset viewer.