From 194764cd45788b1739f0e1c1e2bf15ccfe23dfe6 Mon Sep 17 00:00:00 2001
From: Jeff Ong This is a test text with HTML.
This is a test text with HTML.
'; + $escaped_string = $this->call_private_method( 'escape_text_content', array( $string ) ); + $expected_output = "', '' ); ?>"; + $this->assertEquals( $expected_output, $escaped_string ); } public function test_escape_text_content_with_already_escaped_string() { diff --git a/tests/CbtThemeLocale/escapeTextContentOfBlocks.php b/tests/CbtThemeLocale/escapeTextContentOfBlocks.php index 2fee4adf..34d705c6 100644 --- a/tests/CbtThemeLocale/escapeTextContentOfBlocks.php +++ b/tests/CbtThemeLocale/escapeTextContentOfBlocks.php @@ -108,7 +108,7 @@ public function data_test_escape_text_content_of_blocks() { ', 'expected_markup' => ' -El polvo elemental que nos ignora+
y que fue el rojo Adán y que es ahora
todos los hombres, y que no veremos.\', \'test-locale-theme\');?>
\', \'', ), diff --git a/tests/test-theme-templates.php b/tests/test-theme-templates.php index e2842800..f3aec6e6 100644 --- a/tests/test-theme-templates.php +++ b/tests/test-theme-templates.php @@ -159,12 +159,12 @@ public function test_properly_encode_lessthan_and_greaterthan() { public function test_properly_encode_html_markup() { $template = new stdClass(); - $template->content = ' -
\', \'
\' ); ?>
Bold text has feelings <> TOO
- '; + $template->content = 'Bold text has feelings <> TOO
'; $escaped_template = CBT_Theme_Templates::escape_text_in_template( $template ); - $this->assertStringContainsString( "Bold text has feelings <> TOO', '');?>", $escaped_template->content ); + $expected_output = '\', \'\' ); ?>
'; + + $this->assertStringContainsString( $expected_output, $escaped_template->content ); } public function test_empty_alt_text_is_not_localized() { @@ -262,7 +262,12 @@ public function test_localize_verse() {Here is some verse to localize'; $new_template = CBT_Theme_Templates::escape_text_in_template( $template ); - $this->assertStringContainsString( "verse to localize', '');?>", $new_template->content ); + + $expected_output = ' +
\', \'\' ); ?>+ '; + + $this->assertStringContainsString( $expected_output, $new_template->content ); } public function test_localize_table() {