Changeset 49024
- Timestamp:
- 09/21/2020 11:34:06 AM (4 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/functions/deprecated.php
r49006 r49024 144 144 * @ticket 6821 145 145 * @expectedDeprecated wp_save_image_file 146 * @requires function imagejpeg 146 147 * 147 148 * @covers ::wp_save_image_file 148 149 */ 149 150 public function test_wp_save_image_file_deprecated_with_gd_resource() { 150 if ( ! function_exists( 'imagejpeg' ) ) {151 $this->fail( 'jpeg support unavailable' );152 }153 154 151 // Call wp_save_image_file(). 155 152 require_once ABSPATH . 'wp-admin/includes/image-edit.php'; … … 169 166 * 170 167 * @ticket 6821 168 * @requires function imagejpeg 171 169 * 172 170 * @covers ::wp_save_image_file 173 171 */ 174 172 public function test_wp_save_image_file_not_deprecated_with_wp_image_editor() { 175 if ( ! function_exists( 'imagejpeg' ) ) {176 $this->fail( 'jpeg support unavailable' );177 }178 179 173 // Call wp_save_image_file(). 180 174 require_once ABSPATH . 'wp-admin/includes/image-edit.php'; -
trunk/tests/phpunit/tests/image/functions.php
r49018 r49024 349 349 } 350 350 351 /** 352 * @requires function imagejpeg 353 */ 351 354 public function test_wp_crop_image_file() { 352 if ( ! function_exists( 'imagejpeg' ) ) {353 $this->fail( 'jpeg support unavailable' );354 }355 356 355 $file = wp_crop_image( 357 356 DIR_TESTDATA . '/images/canola.jpg', … … 373 372 } 374 373 374 /** 375 * @requires function imagejpeg 376 */ 375 377 public function test_wp_crop_image_url() { 376 if ( ! function_exists( 'imagejpeg' ) ) {377 $this->fail( 'jpeg support unavailable' );378 }379 380 378 if ( ! extension_loaded( 'openssl' ) ) { 381 379 $this->markTestSkipped( 'Tests_Image_Functions::test_wp_crop_image_url() requires openssl.' ); -
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 ); -
trunk/tests/phpunit/tests/post/attachments.php
r48937 r49024 55 55 } 56 56 57 /** 58 * @requires function imagejpeg 59 */ 57 60 function test_insert_image_thumb_only() { 58 if ( ! function_exists( 'imagejpeg' ) ) {59 $this->fail( 'jpeg support unavailable' );60 }61 62 61 update_option( 'medium_size_w', 0 ); 63 62 update_option( 'medium_size_h', 0 ); … … 107 106 } 108 107 108 /** 109 * @requires function imagejpeg 110 */ 109 111 function test_insert_image_medium_sizes() { 110 if ( ! function_exists( 'imagejpeg' ) ) {111 $this->fail( 'jpeg support unavailable' );112 }113 114 112 update_option( 'medium_size_w', 400 ); 115 113 update_option( 'medium_size_h', 0 ); … … 165 163 } 166 164 167 165 /** 166 * @requires function imagejpeg 167 */ 168 168 function test_insert_image_delete() { 169 if ( ! function_exists( 'imagejpeg' ) ) {170 $this->fail( 'jpeg support unavailable' );171 }172 173 169 update_option( 'medium_size_w', 400 ); 174 170 update_option( 'medium_size_h', 0 );
Note: See TracChangeset
for help on using the changeset viewer.