Changeset 36031 for trunk/tests/phpunit/tests/media.php
- Timestamp:
- 12/20/2015 02:38:34 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/media.php
r35820 r36031 890 890 // The srcset should be false. 891 891 $this->assertFalse( $srcset ); 892 } 893 894 /** 895 * @ticket 34955 896 */ 897 function test_wp_calculate_image_srcset_ratio_variance() { 898 // Mock data for this test. 899 $size_array = array( 218, 300); 900 $image_src = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/2015/12/test-768x1055-218x300.png'; 901 $image_meta = array( 902 'width' => 768, 903 'height' => 1055, 904 'file' => '2015/12/test-768x1055.png', 905 'sizes' => array( 906 'thumbnail' => array( 907 'file' => 'test-768x1055-150x150.png', 908 'width' => 150, 909 'height' => 150, 910 'mime-type' => 'image/png', 911 ), 912 'medium' => array( 913 'file' => 'test-768x1055-218x300.png', 914 'width' => 218, 915 'height' => 300, 916 'mime-type' => 'image/png', 917 ), 918 'custom-600' => array( 919 'file' => 'test-768x1055-600x824.png', 920 'width' => 600, 921 'height' => 824, 922 'mime-type' => 'image/png', 923 ), 924 'post-thumbnail' => array( 925 'file' => 'test-768x1055-768x510.png', 926 'width' => 768, 927 'height' => 510, 928 'mime-type' => 'image/png', 929 ), 930 ), 931 ); 932 933 $expected_srcset = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/2015/12/test-768x1055-218x300.png 218w, http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/2015/12/test-768x1055-600x824.png 600w, http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/2015/12/test-768x1055.png 768w'; 934 935 $this->assertSame( $expected_srcset, wp_calculate_image_srcset( $size_array, $image_src, $image_meta ) ); 892 936 } 893 937
Note: See TracChangeset
for help on using the changeset viewer.