Make WordPress Core

source: trunk/tests/phpunit/includes/mock-image-editor.php @ 42343

Last change on this file since 42343 was 42343, checked in by pento, 8 years ago

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File size: 1.0 KB
Line 
1<?php
2
3if ( class_exists( 'WP_Image_Editor' ) ) :
4
5        class WP_Image_Editor_Mock extends WP_Image_Editor {
6
7                public static $load_return = true;
8                public static $test_return = true;
9                public static $save_return = array();
10
11                // Allow testing of jpeg_quality filter.
12                public function set_mime_type( $mime_type = null ) {
13                        $this->mime_type = $mime_type;
14                }
15
16                public function load() {
17                        return self::$load_return;
18                }
19                public static function test( $args = array() ) {
20                        return self::$test_return;
21                }
22                public static function supports_mime_type( $mime_type ) {
23                        return true;
24                }
25                public function resize( $max_w, $max_h, $crop = false ) {
26
27                }
28                public function multi_resize( $sizes ) {
29
30                }
31                public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
32
33                }
34                public function rotate( $angle ) {
35
36                }
37                public function flip( $horz, $vert ) {
38
39                }
40                public function save( $destfilename = null, $mime_type = null ) {
41                        return self::$save_return;
42                }
43                public function stream( $mime_type = null ) {
44
45                }
46        }
47
48endif;
Note: See TracBrowser for help on using the repository browser.