Skip to content

Commit

Permalink
update image block test and add video block test
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbenedetto committed Nov 7, 2024
1 parent bc1aeb6 commit 3049fef
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/CbtThemeLocale/escapeTextContentOfBlocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ public function data_test_escape_text_content_of_blocks() {

'image' => array(
'block_markup' =>
'<!-- wp:image {"sizeSlug":"large","linkDestination":"none","className":"is-style-rounded"} -->
<figure class="wp-block-image size-large is-style-rounded"><img src="http://localhost/wp1/wp-content/themes/twentytwentyfour/assets/images/windows.webp" alt="Windows of a building in Nuremberg, Germany"/></figure>
'<!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="http://example.org/image.webp" alt="image alt text" class="wp-image-151"/><figcaption class="wp-element-caption">Image caption</figcaption></figure>
<!-- /wp:image -->',
'expected_markup' =>
'<!-- wp:image {"sizeSlug":"large","linkDestination":"none","className":"is-style-rounded"} -->
<figure class="wp-block-image size-large is-style-rounded"><img src="http://localhost/wp1/wp-content/themes/twentytwentyfour/assets/images/windows.webp" alt="<?php esc_attr_e(\'Windows of a building in Nuremberg, Germany\', \'test-locale-theme\');?>"/></figure>
'<!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="http://example.org/image.webp" alt="<?php esc_attr_e(\'image alt text\', \'test-locale-theme\');?>" class="wp-image-151"/><figcaption class="wp-element-caption"><?php esc_html_e(\'Image caption\', \'test-locale-theme\');?></figcaption></figure>
<!-- /wp:image -->',
),

Expand Down Expand Up @@ -186,6 +186,15 @@ public function data_test_escape_text_content_of_blocks() {
<!-- /wp:table -->',
),

'video' => array(
'block_markup' => '<!-- wp:video -->
<figure class="wp-block-video"><video controls src="http://example.org/video.mp4"></video><figcaption class="wp-element-caption">Video caption test</figcaption></figure>
<!-- /wp:video -->',
'expected_markup' =>
'<!-- wp:video -->
<figure class="wp-block-video"><video controls src="http://example.org/video.mp4"></video><figcaption class="wp-element-caption"><?php esc_html_e(\'Video caption test\', \'test-locale-theme\');?></figcaption></figure>
<!-- /wp:video -->',
),
);
}
}

0 comments on commit 3049fef

Please sign in to comment.