Changeset 53495
- Timestamp:
- 06/13/2022 04:42:17 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/functions.php
r53292 r53495 26 26 unlink( $file ); 27 27 } 28 } 29 30 /** 31 * Get the available image editor engine class(es). 32 * 33 * @return string[] Available image editor classes; empty array when none are available. 34 */ 35 private function get_image_editor_engine_classes() { 36 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); 37 38 foreach ( $classes as $key => $class ) { 39 if ( ! call_user_func( array( $class, 'test' ) ) ) { 40 // If the image editor isn't available, skip it. 41 unset( $classes[ $key ] ); 42 } 43 } 44 45 if ( empty( $classes ) ) { 46 $this->markTestSkipped( 'Image editor engines WP_Image_Editor_GD and WP_Image_Editor_Imagick are not supported on this system.' ); 47 } 48 49 return $classes; 28 50 } 29 51 … … 322 344 323 345 /** 324 * Get the available image editor engine class(es).325 *326 * @return string[] Available image editor classes; empty array when none are avaialble.327 */328 private function get_image_editor_engine_classes() {329 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );330 331 foreach ( $classes as $key => $class ) {332 if ( ! call_user_func( array( $class, 'test' ) ) ) {333 // If the image editor isn't available, skip it.334 unset( $classes[ $key ] );335 }336 }337 338 if ( empty( $classes ) ) {339 $this->markTestSkipped( 'Image editor engines WP_Image_Editor_GD and WP_Image_Editor_Imagick are not supported on this system.' );340 }341 342 return $classes;343 }344 345 /**346 346 * @ticket 55403 347 347 */ … … 447 447 } 448 448 449 public function mock_image_editor( $editors ) {450 return array( 'WP_Image_Editor_Mock' );451 }452 453 449 /** 454 450 * @ticket 23325 … … 471 467 remove_filter( 'wp_image_editors', array( $this, 'mock_image_editor' ) ); 472 468 WP_Image_Editor_Mock::$save_return = array(); 469 } 470 471 /** 472 * @see test_wp_crop_image_error_on_saving() 473 */ 474 public function mock_image_editor( $editors ) { 475 return array( 'WP_Image_Editor_Mock' ); 473 476 } 474 477
Note: See TracChangeset
for help on using the changeset viewer.