Suppress deprecated notices for `wp_shrink_dimensions()`.
See #25282. git-svn-id: https://develop.svn.wordpress.org/trunk@25367 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6de2f44495
commit
a3a7be77e3
|
@ -6,6 +6,28 @@
|
|||
* @group upload
|
||||
*/
|
||||
class Tests_Image_Size extends WP_UnitTestCase {
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
add_action( 'deprecated_function_run', array( $this, 'deprecated_function_run_check' ) );
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
parent::tearDown();
|
||||
|
||||
remove_action( 'deprecated_function_run', array( $this, 'deprecated_function_run_check' ) );
|
||||
}
|
||||
|
||||
function deprecated_function_run_check( $function ) {
|
||||
if ( in_array( $function, array( 'wp_shrink_dimensions' ) ) )
|
||||
add_filter( 'deprecated_function_trigger_error', array( $this, 'filter_deprecated_function_trigger_error' ) );
|
||||
}
|
||||
|
||||
function filter_deprecated_function_trigger_error() {
|
||||
remove_filter( 'deprecated_function_trigger_error', array( $this, 'filter_deprecated_function_trigger_error' ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
function test_constrain_dims_zero() {
|
||||
if (!is_callable('wp_constrain_dimensions'))
|
||||
$this->markTestSkipped('wp_constrain_dimensions() is not callable.');
|
||||
|
|
Loading…
Reference in New Issue