Changeset 35560 for trunk/tests/phpunit/tests/media.php
- Timestamp:
- 11/07/2015 01:32:41 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/media.php
r35524 r35560 749 749 $uploads_dir_url . $image_meta['file'] . ' ' . $image_meta['width'] . 'w'; 750 750 751 // Set up test cases for all expected size names and a random one.752 $sizes = array( 'medium', 'medium_large', 'large', 'full' , 'yoav');751 // Set up test cases for all expected size names. 752 $sizes = array( 'medium', 'medium_large', 'large', 'full' ); 753 753 754 754 foreach ( $sizes as $size ) { … … 781 781 $uploads_dir_url . $image_meta['file'] . ' ' . $image_meta['width'] . 'w'; 782 782 783 // Set up test cases for all expected size names and a random one.784 $sizes = array( 'medium', 'medium_large', 'large', 'full' , 'yoav');783 // Set up test cases for all expected size names. 784 $sizes = array( 'medium', 'medium_large', 'large', 'full' ); 785 785 786 786 foreach ( $sizes as $size ) { … … 863 863 $size_array = array( 1600, 1200 ); // full size 864 864 865 $s izes= wp_get_attachment_image_srcset( self::$large_id, $size_array, $image_meta );865 $srcset = wp_get_attachment_image_srcset( self::$large_id, $size_array, $image_meta ); 866 866 867 867 $year_month = date('Y/m'); … … 875 875 $expected .= 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . $image_meta['file'] . ' ' . $image_meta['width'] .'w'; 876 876 877 $this->assertSame( $expected, $s izes);877 $this->assertSame( $expected, $srcset ); 878 878 } 879 879 … … 891 891 892 892 $this->assertFalse( $sizes ); 893 } 894 895 /** 896 * @ticket 33641 897 */ 898 function test_wp_get_attachment_image_srcset_invalidsize() { 899 $image_meta = wp_get_attachment_metadata( self::$large_id ); 900 $invalid_size = 'nailthumb'; 901 $original_size = array( 1600, 1200 ); 902 903 $srcset = wp_get_attachment_image_srcset( self::$large_id, $invalid_size, $image_meta ); 904 905 // Expect a srcset for the original full size image to be returned. 906 $expected = wp_get_attachment_image_srcset( self::$large_id, $original_size, $image_meta ); 907 908 $this->assertSame( $expected, $srcset ); 893 909 } 894 910
Note: See TracChangeset
for help on using the changeset viewer.