diff --git a/projects/plugins/jetpack/changelog/add-videopress-shortcode-cover-test b/projects/plugins/jetpack/changelog/add-videopress-shortcode-cover-test new file mode 100644 index 000000000000..1b3d8c8aa5cb --- /dev/null +++ b/projects/plugins/jetpack/changelog/add-videopress-shortcode-cover-test @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Jetpack VideoPress module: Add test for generated embed code diff --git a/projects/plugins/jetpack/tests/php/modules/videopress/test_class.videopress-player.php b/projects/plugins/jetpack/tests/php/modules/videopress/test_class.videopress-player.php new file mode 100644 index 000000000000..5f2b492d76bd --- /dev/null +++ b/projects/plugins/jetpack/tests/php/modules/videopress/test_class.videopress-player.php @@ -0,0 +1,54 @@ + array( + array( + 'cover' => true, + ), + // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript + "", + ), + 'cover_disabled' => array( + array( + 'cover' => false, + ), + // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript + "", + ), + ); + } + + /** + * Tests the output of html5_dynamic_next(). + * + * @dataProvider get_html_test_data + * @covers VideoPress_Player::test_output_html5_dynamic_next() + * + * @param array $options The player options. + * @param string $expected The expected generated content. + */ + public function test_output_html5_dynamic_next( $options, $expected ) { + $player = new VideoPress_Player( 'testguid', 0, $options ); + $this->assertEquals( $expected, $player->html5_dynamic_next() ); + } +}