From: Brian Wolff Date: Wed, 17 Aug 2011 04:05:11 +0000 (+0000) Subject: follow-up r94601 - add unit tests for stripping the File: prefix from upload, and... X-Git-Tag: 1.31.0-rc.0~28215 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=35706f4206936a2f92648f86e5668b1f96e71a88;p=lhc%2Fweb%2Fwiklou.git follow-up r94601 - add unit tests for stripping the File: prefix from upload, and test handling illegal characters in upload title (thing that caused the issue in r94601) (I have no idea if things like this (unit-tests) should be tagged 1.18, I assume no but am unsure) --- diff --git a/tests/phpunit/includes/upload/UploadTest.php b/tests/phpunit/includes/upload/UploadTest.php index 21204ffbc9..69c2903294 100644 --- a/tests/phpunit/includes/upload/UploadTest.php +++ b/tests/phpunit/includes/upload/UploadTest.php @@ -41,6 +41,16 @@ class UploadTest extends MediaWikiTestCase { 'A-B.jpg', UploadBase::OK, 'upload title with colon' ); + /* Stripping leading File: prefix */ + $this->assertUploadTitleAndCode( 'File:C.jpg', + 'C.jpg', UploadBase::OK, + 'upload title with File prefix' ); + + /* Test illegal suggested title (r94601) */ + $this->assertUploadTitleAndCode( '%281%29.JPG', + null, UploadBase::ILLEGAL_FILENAME, + 'illegal title for upload' ); + /* A title without extension */ $this->assertUploadTitleAndCode( 'A', null, UploadBase::FILETYPE_MISSING,