Skip to content

Commit

Permalink
Try and fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jffng committed Sep 11, 2024
1 parent b80e4eb commit 807653d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/test-theme-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ public function test_properly_encode_html_markup() {
<!-- /wp:paragraph -->';
$escaped_template = CBT_Theme_Templates::escape_text_in_template( $template );

$this->assertStringContainsString( "<?php\n/* Translators: %s are html tags */\necho sprintf( esc_html__( '%sBold%s text has feelings &lt;&gt; TOO', '' ), '<strong>', '</strong>' ); ?>", $escaped_template->content );
$expected_output = "<?php
/* Translators: %s are html tags */
echo sprintf( esc_html__( '%sBold%s text has feelings &lt;&gt; TOO', '' ), '<strong>', '</strong>' ); ?>";

$this->assertStringContainsString( $expected_output, $escaped_template->content );
}

public function test_empty_alt_text_is_not_localized() {
Expand Down Expand Up @@ -262,7 +266,12 @@ public function test_localize_verse() {
<pre class="wp-block-verse">Here is some <strong>verse</strong> to localize</pre>
<!-- /wp:verse -->';
$new_template = CBT_Theme_Templates::escape_text_in_template( $template );
$this->assertStringContainsString( "<?php\n/* Translators: %s are html tags */\necho sprintf( esc_html__( 'Here is some %sverse%s to localize', '' ), '<strong>', '</strong>' ); ?>", $new_template->content );

$expected_output = "<?php
/* Translators: %s are html tags */
echo sprintf( esc_html__( 'Here is some %sverse%s to localize', '' ), '<strong>', '</strong>' ); ?>";

$this->assertStringContainsString( $expected_output, $new_template->content );
}

public function test_localize_table() {
Expand Down

0 comments on commit 807653d

Please sign in to comment.