diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php
index 5d92d9718b..6154091b72 100644
a
|
b
|
EOF; |
2016 | 2016 | /** |
2017 | 2017 | * @ticket 36549 |
2018 | 2018 | * @ticket 33641 |
| 2019 | * @ticket 55274 |
2019 | 2020 | */ |
2020 | | public function test_wp_calculate_image_srcset_with_spaces_in_filenames() { |
| 2021 | public function test_wp_calculate_image_srcset_with_special_chars_in_filenames() { |
2021 | 2022 | // Mock data for this test. |
2022 | | $image_src = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/2015/12/test image-300x150.png'; |
| 2023 | $image_src = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/2015/12/test &!image-300x150.png'; |
2023 | 2024 | $image_meta = array( |
2024 | 2025 | 'width' => 3000, |
2025 | 2026 | 'height' => 1500, |
2026 | 2027 | 'file' => '2015/12/test image.png', |
2027 | 2028 | 'sizes' => array( |
2028 | 2029 | 'thumbnail' => array( |
2029 | | 'file' => 'test image-150x150.png', |
| 2030 | 'file' => 'test &!image-150x150.png', |
2030 | 2031 | 'width' => 150, |
2031 | 2032 | 'height' => 150, |
2032 | 2033 | 'mime-type' => 'image/png', |
2033 | 2034 | ), |
2034 | 2035 | 'medium' => array( |
2035 | | 'file' => 'test image-300x150.png', |
| 2036 | 'file' => 'test &!image-300x150.png', |
2036 | 2037 | 'width' => 300, |
2037 | 2038 | 'height' => 150, |
2038 | 2039 | 'mime-type' => 'image/png', |
2039 | 2040 | ), |
2040 | 2041 | 'medium_large' => array( |
2041 | | 'file' => 'test image-768x384.png', |
| 2042 | 'file' => 'test &!image-768x384.png', |
2042 | 2043 | 'width' => 768, |
2043 | 2044 | 'height' => 384, |
2044 | 2045 | 'mime-type' => 'image/png', |
2045 | 2046 | ), |
2046 | 2047 | 'large' => array( |
2047 | | 'file' => 'test image-1024x512.png', |
| 2048 | 'file' => 'test &!image-1024x512.png', |
2048 | 2049 | 'width' => 1024, |
2049 | 2050 | 'height' => 512, |
2050 | 2051 | 'mime-type' => 'image/png', |
… |
… |
EOF; |
2054 | 2055 | |
2055 | 2056 | $uploads_url = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/2015/12/'; |
2056 | 2057 | |
2057 | | $expected_srcset = $uploads_url . 'test%20image-300x150.png 300w, ' . |
2058 | | $uploads_url . 'test%20image-768x384.png 768w, ' . |
2059 | | $uploads_url . 'test%20image-1024x512.png 1024w'; |
| 2058 | $expected_srcset = $uploads_url . 'test%20%24%21image-300x150.png 300w, ' . |
| 2059 | $uploads_url . 'test%20%24%21image-768x384.png 768w, ' . |
| 2060 | $uploads_url . 'test%20%24%21image-1024x512.png 1024w'; |
2060 | 2061 | |
2061 | 2062 | $this->assertSame( $expected_srcset, wp_calculate_image_srcset( array( 300, 150 ), $image_src, $image_meta ) ); |
2062 | 2063 | } |