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:
Scott Taylor 2013-09-12 04:20:48 +00:00
parent 691e3f25a0
commit 7001aeaa11
1 changed files with 20 additions and 0 deletions

View File

@ -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';