ParserTests: fix `bits` column in uploaded images for test cases.
authorC. Scott Ananian <cscott@cscott.net>
Tue, 3 Jun 2014 19:44:53 +0000 (15:44 -0400)
committerCscott <cananian@wikimedia.org>
Tue, 3 Jun 2014 21:49:40 +0000 (21:49 +0000)
When running parser tests on a sqlite3 database, the insertion of the
djvu image before running the test suite will fail because `NULL` is not
a valid value for the `bits` column of the `image` table.  This will
cause the test suite to eventually fail, since {{NUMBEROFFILES}} differs.

Test uploads show that `bits` is usually set to 0 for both SVG and
DJVU uploads, so fix this (in both the standalone test runner and the
phpunit test runner).

Change-Id: I8689a547d34035534723e87c4c2680c4e67245f2

tests/parser/parserTest.inc
tests/phpunit/includes/parser/NewParserTest.php

index c886011..7e7c42f 100644 (file)
@@ -1007,7 +1007,7 @@ class ParserTest {
                                'size'        => 12345,
                                'width'       => 240,
                                'height'      => 180,
-                               'bits'        => 24,
+                               'bits'        => 0,
                                'media_type'  => MEDIATYPE_DRAWING,
                                'mime'        => 'image/svg+xml',
                                'metadata'    => serialize( array() ),
@@ -1035,6 +1035,7 @@ class ParserTest {
                        'size' => 3249,
                        'width' => 2480,
                        'height' => 3508,
+                       'bits' => 0,
                        'media_type' => MEDIATYPE_BITMAP,
                        'mime' => 'image/vnd.djvu',
                        'metadata' => '<?xml version="1.0" ?>
index e82439a..d322e47 100644 (file)
@@ -277,7 +277,7 @@ class NewParserTest extends MediaWikiTestCase {
                                        'size'        => 12345,
                                        'width'       => 240,
                                        'height'      => 180,
-                                       'bits'        => 24,
+                                       'bits'        => 0,
                                        'media_type'  => MEDIATYPE_DRAWING,
                                        'mime'        => 'image/svg+xml',
                                        'metadata'    => serialize( array() ),
@@ -293,7 +293,7 @@ class NewParserTest extends MediaWikiTestCase {
                                'size' => 3249,
                                'width' => 2480,
                                'height' => 3508,
-                               'bits' => 24,
+                               'bits' => 0,
                                'media_type' => MEDIATYPE_BITMAP,
                                'mime' => 'image/vnd.djvu',
                                'metadata' => '<?xml version="1.0" ?>