Last change
on this file since 25380 was
25380,
checked in by wonderboymusic, 12 years ago
|
- Avoid notice by making
WP_Image_Editor_Mock::test() compatible with WP_Image_Editor::test() .
- Suppress deprecated function notice for
wp_load_image() .
- Add assertion for
wp_get_image_editor() .
See #25282.
|
File size:
925 bytes
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | if (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 | public function load() { |
---|
12 | return self::$load_return; |
---|
13 | } |
---|
14 | public static function test( $args = array() ) { |
---|
15 | return self::$test_return; |
---|
16 | } |
---|
17 | public static function supports_mime_type( $mime_type ) { |
---|
18 | return true; |
---|
19 | } |
---|
20 | public function resize( $max_w, $max_h, $crop = false ) { |
---|
21 | |
---|
22 | } |
---|
23 | public function multi_resize( $sizes ) { |
---|
24 | |
---|
25 | } |
---|
26 | public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) { |
---|
27 | |
---|
28 | } |
---|
29 | public function rotate( $angle ) { |
---|
30 | |
---|
31 | } |
---|
32 | public function flip( $horz, $vert ) { |
---|
33 | |
---|
34 | } |
---|
35 | public function save( $destfilename = null, $mime_type = null ) { |
---|
36 | return self::$save_return; |
---|
37 | } |
---|
38 | public function stream( $mime_type = null ) { |
---|
39 | |
---|
40 | } |
---|
41 | } |
---|
42 | |
---|
43 | endif; |
---|
Note: See
TracBrowser
for help on using the repository browser.