Make WordPress Core

Changeset 25367


Ignore:
Timestamp:
09/11/2013 10:16:43 PM (11 years ago)
Author:
wonderboymusic
Message:

Suppress deprecated notices for wp_shrink_dimensions().

See #25282.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/image/size.php

    r25002 r25367  
    77 */
    88class Tests_Image_Size extends WP_UnitTestCase {
     9    function setUp() {
     10        parent::setUp();
     11
     12        add_action( 'deprecated_function_run', array( $this, 'deprecated_function_run_check' ) );
     13    }
     14
     15    function tearDown() {
     16        parent::tearDown();
     17
     18        remove_action( 'deprecated_function_run', array( $this, 'deprecated_function_run_check' ) );
     19    }
     20
     21    function deprecated_function_run_check( $function ) {
     22        if ( in_array( $function, array( 'wp_shrink_dimensions' ) ) )
     23            add_filter( 'deprecated_function_trigger_error', array( $this, 'filter_deprecated_function_trigger_error' ) );
     24    }
     25
     26    function filter_deprecated_function_trigger_error() {
     27        remove_filter( 'deprecated_function_trigger_error', array( $this, 'filter_deprecated_function_trigger_error' ) );
     28        return false;
     29    }
     30
    931    function test_constrain_dims_zero() {
    1032        if (!is_callable('wp_constrain_dimensions'))
Note: See TracChangeset for help on using the changeset viewer.