Make WordPress Core

Changeset 27100


Ignore:
Timestamp:
02/05/2014 05:16:22 AM (11 years ago)
Author:
wonderboymusic
Message:

The unit test for the video shortcode needs to mimic the default params for width and post ID.

See #26628.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/media.php

    r27097 r27100  
    374374        $height = 480;
    375375
     376        $post_id = get_post() ? get_the_ID() : 0;
     377
    376378        $video =<<<VIDEO
    377379[video width="720" height="480" mp4="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4"]
     
    387389VIDEO;
    388390
    389         $w = $GLOBALS['content_width'];
     391        $w = empty( $GLOBALS['content_width'] ) ? 640 : $GLOBALS['content_width'];
    390392        $h = ceil( ( $height * $w ) / $width );
    391393
     
    394396        $expected = '<div style="width: ' . $w . 'px; max-width: 100%;" class="wp-video">' .
    395397            "<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n" .
    396             '<video class="wp-video-shortcode" id="video-0-1" width="' . $w . '" height="' . $h . '" preload="metadata" controls="controls">' .
     398            '<video class="wp-video-shortcode" id="video-' . $post_id . '-1" width="' . $w . '" height="' . $h . '" preload="metadata" controls="controls">' .
    397399            '<source type="video/mp4" src="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4" />' .
    398400            '<!-- WebM/VP8 for Firefox4, Opera, and Chrome --><source type="video/webm" src="myvideo.webm" />' .
Note: See TracChangeset for help on using the changeset viewer.