diff --git tests/phpunit/tests/media.php tests/phpunit/tests/media.php
index 5734f3e..75e7df5 100644
|
|
EOF; |
748 | 748 | $uploads_dir_url . $year_month . '/' . $image_meta['sizes']['large']['file'] . ' ' . $image_meta['sizes']['large']['width'] . 'w, ' . |
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 ) { |
755 | 755 | $image_url = wp_get_attachment_image_url( self::$large_id, $size ); |
… |
… |
EOF; |
780 | 780 | $uploads_dir_url . $image_meta['sizes']['large']['file'] . ' ' . $image_meta['sizes']['large']['width'] . 'w, ' . |
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 ) { |
787 | 787 | $size_array = $this->_get_image_size_array_from_name( $size ); |
… |
… |
EOF; |
862 | 862 | $image_meta = wp_get_attachment_metadata( self::$large_id ); |
863 | 863 | $size_array = array( 1600, 1200 ); // full size |
864 | 864 | |
865 | | $sizes = 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'); |
868 | 868 | |
… |
… |
EOF; |
874 | 874 | . $image_meta['sizes']['large']['file'] . ' ' . $image_meta['sizes']['large']['width'] . 'w, '; |
875 | 875 | $expected .= 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . $image_meta['file'] . ' ' . $image_meta['width'] .'w'; |
876 | 876 | |
877 | | $this->assertSame( $expected, $sizes ); |
| 877 | $this->assertSame( $expected, $srcset ); |
878 | 878 | } |
879 | 879 | |
880 | 880 | /** |
… |
… |
EOF; |
895 | 895 | /** |
896 | 896 | * @ticket 33641 |
897 | 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 ); |
| 909 | } |
| 910 | |
| 911 | /** |
| 912 | * @ticket 33641 |
| 913 | */ |
898 | 914 | function test_wp_get_attachment_image_sizes() { |
899 | 915 | // Test sizes against the default WP sizes. |
900 | 916 | $intermediates = array('thumbnail', 'medium', 'medium_large', 'large'); |