Skip to content

Commit

Permalink
add quotes test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbenedetto committed May 15, 2024
1 parent 77df0e1 commit 42565b2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/CbtThemeLocale/escapeString.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ public function test_escape_string() {
$this->assertEquals( "<?php echo __( 'This is a test text.', 'test-locale-theme' ); ?>", $escaped_string );
}

public function test_escape_string_with_single_quote() {
$string = "This is a test text with a single quote '";
$escaped_string = CBT_Theme_Locale::escape_string( $string );
$this->assertEquals( "<?php echo __( 'This is a test text with a single quote \\'', 'test-locale-theme' ); ?>", $escaped_string );
}

public function test_escape_string_with_double_quote() {
$string = 'This is a test text with a double quote "';
$escaped_string = CBT_Theme_Locale::escape_string( $string );
$this->assertEquals( "<?php echo __( 'This is a test text with a double quote \"', 'test-locale-theme' ); ?>", $escaped_string );
}

public function test_escape_string_with_html() {
$string = '<p>This is a test text with HTML.</p>';
$escaped_string = CBT_Theme_Locale::escape_string( $string );
Expand Down

0 comments on commit 42565b2

Please sign in to comment.