Changeset 25380
- Timestamp:
- 09/12/2013 04:40:13 AM (11 years ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/mock-image-editor.php
r25002 r25380 12 12 return self::$load_return; 13 13 } 14 public static function test( ) {14 public static function test( $args = array() ) { 15 15 return self::$test_return; 16 16 } -
trunk/tests/phpunit/tests/image/functions.php
r25002 r25380 10 10 * Setup test fixture 11 11 */ 12 public function setup() { 12 public function setUp() { 13 parent::setUp(); 14 13 15 require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' ); 14 16 require_once( ABSPATH . WPINC . '/class-wp-image-editor-gd.php' ); … … 16 18 17 19 include_once( DIR_TESTDATA . '/../includes/mock-image-editor.php' ); 20 add_action( 'deprecated_function_run', array( $this, 'deprecated_function_run' ) ); 21 } 22 23 function tearDown() { 24 parent::tearDown(); 25 remove_action( 'deprecated_function_run', array( $this, 'deprecated_function_run' ) ); 26 } 27 28 function deprecated_function_run( $function ) { 29 if ( in_array( $function, array( 'wp_load_image' ) ) ) 30 add_filter( 'deprecated_function_trigger_error', array( $this, 'deprecated_function_trigger_error' ) ); 31 } 32 33 function deprecated_function_trigger_error() { 34 remove_filter( 'deprecated_function_trigger_error', array( $this, 'deprecated_function_trigger_error' ) ); 35 return false; 18 36 } 19 37 … … 237 255 238 256 // First, test with deprecated wp_load_image function 239 $editor = wp_load_image( DIR_TESTDATA ); 240 $this->assertNotInternalType( 'resource', $editor ); 257 $editor1 = wp_load_image( DIR_TESTDATA ); 258 $this->assertNotInternalType( 'resource', $editor1 ); 259 260 $editor2 = wp_get_image_editor( DIR_TESTDATA ); 261 $this->assertNotInternalType( 'resource', $editor2 ); 241 262 242 263 // Then, test with editors.
Note: See TracChangeset
for help on using the changeset viewer.