From dece73dff9f8f4100865faa68bc3070ffec6e269 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Tue, 3 Jun 2014 15:44:53 -0400 Subject: [PATCH] ParserTests: fix `bits` column in uploaded images for test cases. 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 | 3 ++- tests/phpunit/includes/parser/NewParserTest.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index c886011214..7e7c42ffce 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -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' => ' diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index e82439a424..d322e47212 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -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' => ' -- 2.20.1