Tests: Add a new test file missed in [33359].
git-svn-id: https://develop.svn.wordpress.org/trunk@33391 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f9ec35ddab
commit
2e74ecfc1c
37
tests/phpunit/tests/formatting/WpReplaceInHtmlTags.php
Executable file
37
tests/phpunit/tests/formatting/WpReplaceInHtmlTags.php
Executable file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @group formatting
|
||||
*/
|
||||
class Tests_Formatting_WpReplaceInTags extends WP_UnitTestCase {
|
||||
/**
|
||||
* Check for expected behavior of new function wp_replace_in_html_tags().
|
||||
*
|
||||
* @dataProvider data_wp_replace_in_html_tags
|
||||
*/
|
||||
function test_wp_replace_in_html_tags( $input, $output ) {
|
||||
return $this->assertEquals( $output, wp_replace_in_html_tags( $input, array( "\n" => " " ) ) );
|
||||
}
|
||||
|
||||
function data_wp_replace_in_html_tags() {
|
||||
return array(
|
||||
array(
|
||||
"Hello \n World",
|
||||
"Hello \n World",
|
||||
),
|
||||
array(
|
||||
"<Hello \n World>",
|
||||
"<Hello World>",
|
||||
),
|
||||
array(
|
||||
"<!-- Hello \n World -->",
|
||||
"<!-- Hello World -->",
|
||||
),
|
||||
array(
|
||||
"<!-- Hello <\n> World -->",
|
||||
"<!-- Hello < > World -->",
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue
Block a user