Skip to content

Commit 9f43b73

Browse files
committed
Update content with html test.
1 parent 0460dc5 commit 9f43b73

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/CbtThemeLocale/escapeTextContent.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ public function test_escape_text_content_with_double_quote() {
3737
}
3838

3939
public function test_escape_text_content_with_html() {
40-
$string = '<p>This is a test text with HTML.</p>';
41-
$escaped_string = $this->call_private_method( 'escape_text_content', array( $string ) );
42-
$this->assertEquals( "<?php esc_html_e('<p>This is a test text with HTML.</p>', 'test-locale-theme');?>", $escaped_string );
40+
$string = '<p>This is a test text with HTML.</p>';
41+
$escaped_string = $this->call_private_method( 'escape_text_content', array( $string ) );
42+
$expected_output = "<?php\n/* Translators: %s are html tags */\necho sprintf( esc_html__( '%sThis is a test text with HTML.%s', 'test-locale-theme' ), '<p>', '</p>'); ?>";
43+
$this->assertEquals( $expected_output, $escaped_string );
4344
}
4445

4546
public function test_escape_text_content_with_already_escaped_string() {

0 commit comments

Comments
 (0)