Skip to content

Commit

Permalink
Fix test cases for YouTube and TikTok embeds
Browse files Browse the repository at this point in the history
  • Loading branch information
thelovekesh committed Jun 17, 2022
1 parent e4e5396 commit 1accc15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/php/test-class-amp-tiktok-embed-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function get_conversion_data() {
'
<amp-tiktok layout="fixed-height" height="755" width="auto" data-src="https://www.tiktok.com/@scout2015/video/6718335390845095173">
<blockquote class="tiktok-embed" cite="https://www.tiktok.com/@scout2015/video/6718335390845095173" data-video-id="6718335390845095173" placeholder>
<section> <a target="_blank" title="@scout2015" href="https://www.tiktok.com/@scout2015">@scout2015</a>
<section> <a target="_blank" title="@scout2015" href="https://www.tiktok.com/@scout2015?refer=embed">@scout2015</a>
<p>Scramble up ur name &amp; I’ll try to guess it😍❤️ <a title="foryoupage" target="_blank" href="https://www.tiktok.com/tag/foryoupage">#foryoupage</a> <a title="petsoftiktok" target="_blank" href="https://www.tiktok.com/tag/petsoftiktok">#petsoftiktok</a> <a title="aesthetic" target="_blank" href="https://www.tiktok.com/tag/aesthetic">#aesthetic</a></p>
<p> <a target="_blank" title="♬ original sound - tiff" href="https://www.tiktok.com/music/original-sound-6689804660171082501">♬ original sound – tiff</a> </p></section>
</blockquote>
Expand Down
6 changes: 6 additions & 0 deletions tests/php/test-class-amp-youtube-embed-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ public function test__conversion( $source, $expected, $fallback_for_expected = n

$filtered_content = apply_filters( 'the_content', $source );

// Remove alt and title attributes from the expected output.
if ( version_compare( get_bloginfo( 'version' ), '4.9', '=' ) ) {
$expected = str_replace( 'title="Rebecca Black - Friday"', '', $expected );
$expected = str_replace( 'alt="Rebecca Black - Friday"', '', $expected );
}

if (
version_compare( strtok( get_bloginfo( 'version' ), '-' ), '5.1', '<' )
&& null !== $fallback_for_expected
Expand Down

0 comments on commit 1accc15

Please sign in to comment.