Skip to content

Commit

Permalink
Vimeo: add test for new supported shortcode format.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve committed Jan 21, 2020
1 parent 8ba90a6 commit b8686d1
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/php/modules/shortcodes/test-class.vimeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function test_shortcodes_vimeo_url() {
* @covers ::vimeo_shortcode
* @since 3.2
*/
public function test_shortcodes_vimeo_w_h() {
public function test_shortcodes_vimeo_w_h_old_format() {
$video_id = '141358';
$width = '350';
$height = '500';
Expand All @@ -81,6 +81,23 @@ public function test_shortcodes_vimeo_w_h() {
$this->assertContains( 'height="' . $height . '"', $shortcode_content );
}

/**
* @covers ::vimeo_shortcode
* @since 8.2
*/
public function test_shortcodes_vimeo_w_h_new_format() {
$video_id = '141358';
$width = '350';
$height = '500';
$content = '[vimeo ' . $video_id . ' w=' . $width . ' h=' . $height . ']';

$shortcode_content = do_shortcode( $content );

$this->assertContains( 'vimeo.com/video/' . $video_id, $shortcode_content );
$this->assertContains( 'width="' . $width . '"', $shortcode_content );
$this->assertContains( 'height="' . $height . '"', $shortcode_content );
}

/**
* @author scotchfield
* @covers ::vimeo_shortcode
Expand Down

0 comments on commit b8686d1

Please sign in to comment.