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

See #26628.



git-svn-id: https://develop.svn.wordpress.org/trunk@27100 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-02-05 05:16:22 +00:00
parent 22fef7cf4b
commit 9b85472ac9

View File

@ -373,6 +373,8 @@ CONTENT;
$width = 720;
$height = 480;
$post_id = get_post() ? get_the_ID() : 0;
$video =<<<VIDEO
[video width="720" height="480" mp4="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4"]
<!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
@ -386,14 +388,14 @@ CONTENT;
[/video]
VIDEO;
$w = $GLOBALS['content_width'];
$w = empty( $GLOBALS['content_width'] ) ? 640 : $GLOBALS['content_width'];
$h = ceil( ( $height * $w ) / $width );
$content = apply_filters( 'the_content', $video );
$expected = '<div style="width: ' . $w . 'px; max-width: 100%;" class="wp-video">' .
"<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n" .
'<video class="wp-video-shortcode" id="video-0-1" width="' . $w . '" height="' . $h . '" preload="metadata" controls="controls">' .
'<video class="wp-video-shortcode" id="video-' . $post_id . '-1" width="' . $w . '" height="' . $h . '" preload="metadata" controls="controls">' .
'<source type="video/mp4" src="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4" />' .
'<!-- WebM/VP8 for Firefox4, Opera, and Chrome --><source type="video/webm" src="myvideo.webm" />' .
'<!-- Ogg/Vorbis for older Firefox and Opera versions --><source type="video/ogg" src="myvideo.ogv" />' .