Changeset 49024 for trunk/tests/phpunit/tests/image/intermediateSize.php
- Timestamp:
- 09/21/2020 11:34:06 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/intermediateSize.php
r49010 r49024 29 29 } 30 30 31 /** 32 * @requires function imagejpeg 33 */ 31 34 function test_make_intermediate_size_width() { 32 if ( ! function_exists( 'imagejpeg' ) ) {33 $this->fail( 'jpeg support unavailable' );34 }35 36 35 $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 100, 0, false ); 37 36 … … 39 38 } 40 39 40 /** 41 * @requires function imagejpeg 42 */ 41 43 function test_make_intermediate_size_height() { 42 if ( ! function_exists( 'imagejpeg' ) ) {43 $this->fail( 'jpeg support unavailable' );44 }45 46 44 $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 0, 75, false ); 47 45 … … 49 47 } 50 48 49 /** 50 * @requires function imagejpeg 51 */ 51 52 function test_make_intermediate_size_successful() { 52 if ( ! function_exists( 'imagejpeg' ) ) {53 $this->fail( 'jpeg support unavailable' );54 }55 56 53 $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 100, 75, true ); 57 54 … … 68 65 /** 69 66 * @ticket 17626 67 * @requires function imagejpeg 70 68 */ 71 69 function test_get_intermediate_sizes_by_name() { 72 if ( ! function_exists( 'imagejpeg' ) ) {73 $this->fail( 'jpeg support unavailable' );74 }75 76 70 add_image_size( 'test-size', 330, 220, true ); 77 71 … … 92 86 /** 93 87 * @ticket 17626 88 * @requires function imagejpeg 94 89 */ 95 90 function test_get_intermediate_sizes_by_array_exact() { 96 if ( ! function_exists( 'imagejpeg' ) ) {97 $this->fail( 'jpeg support unavailable' );98 }99 100 91 // Only one dimention match shouldn't return false positive (see: #17626). 101 92 add_image_size( 'test-size', 330, 220, true ); … … 117 108 /** 118 109 * @ticket 17626 110 * @requires function imagejpeg 119 111 */ 120 112 function test_get_intermediate_sizes_by_array_nearest() { 121 if ( ! function_exists( 'imagejpeg' ) ) {122 $this->fail( 'jpeg support unavailable' );123 }124 125 113 // If an exact size is not found, it should be returned. 126 114 // If not, find nearest size that is larger (see: #17626). … … 164 152 /** 165 153 * @ticket 17626 154 * @requires function imagejpeg 166 155 */ 167 156 function test_get_intermediate_sizes_by_array_zero_height() { 168 if ( ! function_exists( 'imagejpeg' ) ) {169 $this->fail( 'jpeg support unavailable' );170 }171 172 157 // Generate random width. 173 158 $random_w = rand( 300, 400 ); … … 196 181 * @ticket 17626 197 182 * @ticket 34087 183 * @requires function imagejpeg 198 184 */ 199 185 function test_get_intermediate_sizes_by_array_zero_width() { 200 if ( ! function_exists( 'imagejpeg' ) ) {201 $this->fail( 'jpeg support unavailable' );202 }203 204 186 // 202 is the smallest height that will trigger a miss for 'false-height'. 205 187 $height = 202; … … 228 210 * @ticket 17626 229 211 * @ticket 34087 212 * @requires function imagejpeg 230 213 */ 231 214 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 236 215 // Original is 600x400. 300x201 is close enough to match. 237 216 $width = 300; … … 255 234 /** 256 235 * @ticket 34384 236 * @requires function imagejpeg 257 237 */ 258 238 public function test_get_intermediate_size_with_small_size_array() { 259 if ( ! function_exists( 'imagejpeg' ) ) {260 $this->fail( 'jpeg support unavailable' );261 }262 263 239 // Add a hard cropped size that matches the aspect ratio we're going to test. 264 240 add_image_size( 'test-size', 200, 100, true ); … … 276 252 /** 277 253 * @ticket 34384 254 * @requires function imagejpeg 278 255 */ 279 256 public function test_get_intermediate_size_with_small_size_array_fallback() { 280 if ( ! function_exists( 'imagejpeg' ) ) {281 $this->fail( 'jpeg support unavailable' );282 }283 284 257 $file = DIR_TESTDATA . '/images/waffles.jpg'; 285 258 $id = $this->_make_attachment( $file, 0 );
Note: See TracChangeset
for help on using the changeset viewer.