Changeset 49010
- Timestamp:
- 09/20/2020 03:31:46 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/intermediateSize.php
r48937 r49010 70 70 */ 71 71 function test_get_intermediate_sizes_by_name() { 72 if ( ! function_exists( 'imagejpeg' ) ) { 73 $this->fail( 'jpeg support unavailable' ); 74 } 75 72 76 add_image_size( 'test-size', 330, 220, true ); 73 77 … … 90 94 */ 91 95 function test_get_intermediate_sizes_by_array_exact() { 96 if ( ! function_exists( 'imagejpeg' ) ) { 97 $this->fail( 'jpeg support unavailable' ); 98 } 99 92 100 // Only one dimention match shouldn't return false positive (see: #17626). 93 101 add_image_size( 'test-size', 330, 220, true ); … … 111 119 */ 112 120 function test_get_intermediate_sizes_by_array_nearest() { 121 if ( ! function_exists( 'imagejpeg' ) ) { 122 $this->fail( 'jpeg support unavailable' ); 123 } 124 113 125 // If an exact size is not found, it should be returned. 114 126 // If not, find nearest size that is larger (see: #17626). … … 154 166 */ 155 167 function test_get_intermediate_sizes_by_array_zero_height() { 168 if ( ! function_exists( 'imagejpeg' ) ) { 169 $this->fail( 'jpeg support unavailable' ); 170 } 171 156 172 // Generate random width. 157 173 $random_w = rand( 300, 400 ); … … 182 198 */ 183 199 function test_get_intermediate_sizes_by_array_zero_width() { 200 if ( ! function_exists( 'imagejpeg' ) ) { 201 $this->fail( 'jpeg support unavailable' ); 202 } 203 184 204 // 202 is the smallest height that will trigger a miss for 'false-height'. 185 205 $height = 202; … … 210 230 */ 211 231 public function test_get_intermediate_sizes_should_match_size_with_off_by_one_aspect_ratio() { 232 if ( ! function_exists( 'imagejpeg' ) ) { 233 $this->fail( 'jpeg support unavailable' ); 234 } 235 212 236 // Original is 600x400. 300x201 is close enough to match. 213 237 $width = 300; … … 233 257 */ 234 258 public function test_get_intermediate_size_with_small_size_array() { 259 if ( ! function_exists( 'imagejpeg' ) ) { 260 $this->fail( 'jpeg support unavailable' ); 261 } 262 235 263 // Add a hard cropped size that matches the aspect ratio we're going to test. 236 264 add_image_size( 'test-size', 200, 100, true ); … … 250 278 */ 251 279 public function test_get_intermediate_size_with_small_size_array_fallback() { 280 if ( ! function_exists( 'imagejpeg' ) ) { 281 $this->fail( 'jpeg support unavailable' ); 282 } 283 252 284 $file = DIR_TESTDATA . '/images/waffles.jpg'; 253 285 $id = $this->_make_attachment( $file, 0 );
Note: See TracChangeset
for help on using the changeset viewer.