Suppress the deprecated function notice in tests/formatting/CleanPre.php
See #25282. git-svn-id: https://develop.svn.wordpress.org/trunk@25378 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
691e3f25a0
commit
7001aeaa11
@ -7,6 +7,26 @@
|
||||
* @group formatting
|
||||
*/
|
||||
class Tests_Formatting_CleanPre 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( 'clean_pre' ) ) )
|
||||
add_filter( 'deprecated_function_trigger_error', array( $this, 'deprecated_function_trigger_error' ) );
|
||||
}
|
||||
|
||||
function deprecated_function_trigger_error() {
|
||||
remove_filter( 'deprecated_function_trigger_error', array( $this, 'deprecated_function_trigger_error' ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
function test_removes_self_closing_br_with_space() {
|
||||
$source = 'a b c\n<br />sldfj<br />';
|
||||
$res = 'a b c\nsldfj';
|
||||
|
Loading…
Reference in New Issue
Block a user