Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur791004 committed Aug 27, 2024
1 parent cb1dc64 commit 72d4cea
Showing 1 changed file with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,32 +92,6 @@ public function get_youtube_id_options() {
);
}

/**
* @author Toro_Unit
* @covers ::youtube_shortcode
* @since 3.9
*/
public function test_replace_url_with_iframe_in_the_content() {
global $post;

$youtube_id = 'JaNH56Vpg-A';
$url = 'http://www.youtube.com/watch?v=' . $youtube_id;
$post = self::factory()->post->create_and_get( array( 'post_content' => $url ) );

wpcom_youtube_embed_crazy_url_init();
setup_postdata( $post );
ob_start();
// This below is needed since Core inserts "loading=lazy" right after the iframe opener.
add_filter( 'wp_lazy_loading_enabled', '__return_false' );
the_content();
remove_all_filters( 'wp_lazy_loading_enabled' );
$actual = ob_get_clean();
wp_reset_postdata();
$this->assertStringContainsString( '<span class="embed-youtube"', $actual );
$this->assertStringContainsString( '<iframe class="youtube-player"', $actual );
$this->assertStringContainsString( "https://www.youtube.com/embed/$youtube_id", $actual );
}

/**
* Gets the test data for jetpack_shortcode_youtube_args().
*
Expand Down

0 comments on commit 72d4cea

Please sign in to comment.