Changeset 48291 for trunk/tests/phpunit/includes/mock-image-editor.php
- Timestamp:
- 07/04/2020 04:13:17 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/mock-image-editor.php
r46586 r48291 8 8 public static $test_return = true; 9 9 public static $save_return = array(); 10 public static $spy = array(); 11 public static $edit_return = array(); 12 public static $size_return = null; 10 13 11 14 // Allow testing of jpeg_quality filter. … … 24 27 } 25 28 public function resize( $max_w, $max_h, $crop = false ) { 26 29 self::$spy[ __FUNCTION__ ][] = func_get_args(); 30 if ( isset( self::$edit_return[ __FUNCTION__ ] ) ) { 31 return self::$edit_return[ __FUNCTION__ ]; 32 } 27 33 } 28 34 public function multi_resize( $sizes ) { 29 35 self::$spy[ __FUNCTION__ ][] = func_get_args(); 36 if ( isset( self::$edit_return[ __FUNCTION__ ] ) ) { 37 return self::$edit_return[ __FUNCTION__ ]; 38 } 30 39 } 31 40 public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) { 32 41 self::$spy[ __FUNCTION__ ][] = func_get_args(); 42 if ( isset( self::$edit_return[ __FUNCTION__ ] ) ) { 43 return self::$edit_return[ __FUNCTION__ ]; 44 } 33 45 } 34 46 public function rotate( $angle ) { 35 47 self::$spy[ __FUNCTION__ ][] = func_get_args(); 48 if ( isset( self::$edit_return[ __FUNCTION__ ] ) ) { 49 return self::$edit_return[ __FUNCTION__ ]; 50 } 36 51 } 37 52 public function flip( $horz, $vert ) { 38 53 self::$spy[ __FUNCTION__ ][] = func_get_args(); 54 if ( isset( self::$edit_return[ __FUNCTION__ ] ) ) { 55 return self::$edit_return[ __FUNCTION__ ]; 56 } 39 57 } 40 58 public function save( $destfilename = null, $mime_type = null ) { … … 44 62 45 63 } 64 65 public function get_size() { 66 if ( self::$size_return ) { 67 return self::$size_return; 68 } 69 70 return parent::get_size(); 71 } 46 72 } 47 73
Note: See TracChangeset
for help on using the changeset viewer.