jenkins-bot has submitted this change and it was merged.

Change subject: ParserTests: Add a video file to parser test suite
......................................................................


ParserTests: Add a video file to parser test suite

Introduce an ogv video file to the parser file testsuite, so that we
can use it later in TimedMediaHandler parsertests.

Change-Id: I6a3b307ad9c82e9df0aeec025934d736eec8375f
---
M tests/parser/parserTest.inc
M tests/parser/parserTests.txt
A tests/phpunit/data/parser/320x240.ogv
M tests/phpunit/includes/parser/NewParserTest.php
4 files changed, 44 insertions(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc
index 6a6d447..cf65a0d 100644
--- a/tests/parser/parserTest.inc
+++ b/tests/parser/parserTest.inc
@@ -1099,6 +1099,19 @@
                        'fileExists' => true
                ), $this->db->timestamp( '20010115123500' ), $user );
 
+               $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Video.ogv' ) 
);
+               $image->recordUpload2( '', 'A pretty movie', 'Will it play', 
array(
+                       'size' => 12345,
+                       'width' => 320,
+                       'height' => 240,
+                       'bits' => 0,
+                       'media_type' => MEDIATYPE_VIDEO,
+                       'mime' => 'application/ogg',
+                       'metadata' => serialize( array() ),
+                       'sha1' => Wikimedia\base_convert( '', 16, 36, 31 ),
+                       'fileExists' => true
+               ), $this->db->timestamp( '20010115123500' ), $user );
+
                # A DjVu file
                $image = wfLocalFile( Title::makeTitle( NS_FILE, 
'LoremIpsum.djvu' ) );
                $image->recordUpload2( '', 'Upload a DjVu', 'A DjVu', array(
@@ -1212,6 +1225,8 @@
                        ' version="1.1" width="240" height="180"/>' );
                wfMkdirParents( $dir . '/5/5f', null, __METHOD__ );
                copy( "$IP/tests/phpunit/data/parser/LoremIpsum.djvu", 
"$dir/5/5f/LoremIpsum.djvu" );
+               wfMkdirParents( $dir . '/0/00', null, __METHOD__ );
+               copy( "$IP/tests/phpunit/data/parser/320x240.ogv", 
"$dir/0/00/Video.ogv" );
 
                return;
        }
@@ -1253,6 +1268,14 @@
                                "$dir/f/ff/Foobar.svg",
                                "$dir/thumb/f/ff/Foobar.svg/*-Foobar.svg.png",
                                
"$dir/math/f/a/5/fa50b8b616463173474302ca3e63586b.png",
+                               "$dir/0/00/Video.ogv",
+                               
"$dir/thumb/0/00/Video.ogv/120px--Video.ogv.jpg",
+                               
"$dir/thumb/0/00/Video.ogv/180px--Video.ogv.jpg",
+                               
"$dir/thumb/0/00/Video.ogv/240px--Video.ogv.jpg",
+                               
"$dir/thumb/0/00/Video.ogv/320px--Video.ogv.jpg",
+                               
"$dir/thumb/0/00/Video.ogv/270px--Video.ogv.jpg",
+                               
"$dir/thumb/0/00/Video.ogv/320px-seek=2-Video.ogv.jpg",
+                               
"$dir/thumb/0/00/Video.ogv/320px-seek=3.3666666666667-Video.ogv.jpg",
                        )
                );
 
@@ -1270,10 +1293,14 @@
                                "$dir/thumb/f/ff/Foobar.svg",
                                "$dir/thumb/f/ff/",
                                "$dir/thumb/f/",
+                               "$dir/0/00/",
                                "$dir/0/09/",
                                "$dir/0/",
                                "$dir/5/5f",
                                "$dir/5",
+                               "$dir/thumb/0/00/Video.ogv",
+                               "$dir/thumb/0/00",
+                               "$dir/thumb/0",
                                "$dir/thumb/5/5f/LoremIpsum.djvu",
                                "$dir/thumb/5/5f",
                                "$dir/thumb/5",
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index d0a3d08..cd2b769 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -9669,7 +9669,7 @@
 !! wikitext
 {{NUMBEROFFILES}}
 !! html
-<p>5
+<p>6
 </p>
 !! end
 
diff --git a/tests/phpunit/data/parser/320x240.ogv 
b/tests/phpunit/data/parser/320x240.ogv
new file mode 100644
index 0000000..7903820
--- /dev/null
+++ b/tests/phpunit/data/parser/320x240.ogv
Binary files differ
diff --git a/tests/phpunit/includes/parser/NewParserTest.php 
b/tests/phpunit/includes/parser/NewParserTest.php
index 5c6c17d..256ad69 100644
--- a/tests/phpunit/includes/parser/NewParserTest.php
+++ b/tests/phpunit/includes/parser/NewParserTest.php
@@ -304,6 +304,22 @@
                        ), $this->db->timestamp( '20010115123500' ), $user );
                }
 
+               $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Video.ogv' ) 
);
+               if ( !$this->db->selectField( 'image', '1', array( 'img_name' 
=> $image->getName() ) ) ) {
+                       $image->recordUpload2( '', 'A pretty movie', 'Will it 
play', array(
+                                       'size'        => 12345,
+                                       'width'       => 240,
+                                       'height'      => 180,
+                                       'bits'        => 0,
+                                       'media_type'  => MEDIATYPE_VIDEO,
+                                       'mime'        => 'application/ogg',
+                                       'metadata'    => serialize( array() ),
+                                       'sha1'        => 
Wikimedia\base_convert( '', 16, 36, 31 ),
+                                       'fileExists'  => true
+                       ), $this->db->timestamp( '20010115123500' ), $user );
+               }
+
+               # A DjVu file
                # A DjVu file
                $image = wfLocalFile( Title::makeTitle( NS_FILE, 
'LoremIpsum.djvu' ) );
                if ( !$this->db->selectField( 'image', '1', array( 'img_name' 
=> $image->getName() ) ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/262873
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6a3b307ad9c82e9df0aeec025934d736eec8375f
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to