Commit graph

1094 commits

Author SHA1 Message Date
jenkins-bot
0335c4c6e1 Merge "(bug 42639) Fix API action=options for multiselect prefs" 2012-12-14 14:55:04 +00:00
jeroendedauw
9e4761e3aa Fixed SiteArray serialization
Change-Id: I9844236b8720d96f99aef788ab023c522f993045
2012-12-12 20:00:03 +01:00
Antoine Musso
750db30d9b abstract utf8 validation fallback
Language class had a code snippet to verify whether a text is valid
UTF-8 though that could not be used from another place. The snippet use
mb_check_encoding() and fallback to some regex whenever mbstring is not
available.

* introduce StringUtils::isUtf8() which is mostly code moved out of the
  language class.
* Enhance regex readability by using an expanded regex (//x)
* Made the regex to recognize longer sequences
* Add some unit tests to the mbstring and the PHP native implementation
* An optional second parameter can be passed to isUtf8() to force the
  use of our PHP implementation. This is used for unit testing.

Change-Id: I4cf4dfe2eb02f046db1726f4654ba649e01419f2
2012-12-12 11:24:38 +00:00
jan
8b5bfd8b88 (bug 24620) Add types and test for LogFormatter
This change adds types to LogFormatter like "msg" so log values
(parameters for the log message) can be formated as e.g. a message in
user or content language.

This change adds tests for LogFormatter, too. Tested are the normal log
params, the log params with type and the output of the comment.

This change repairs the changes I6a56c204 and I7218a173

Change-Id: Ief3665056b3bb613ff709821306017ee7967c444
2012-12-12 01:00:03 +00:00
Platonides
3118c450e4 Remove the \ before the class name.
Then 'stdclass' is preceded by T_NEW and taken as a class name.
Else it was misinterpreted as a function call.

Change-Id: Ib6afccb26e530a24bf7414ede10f573a9934d2ed
2012-12-11 00:08:41 +01:00
jenkins-bot
94db914b71 Merge "Less wild whitespace" 2012-12-10 15:12:49 +00:00
Siebrand
1879a95a76 Revert "(bug 24620) Add tests for LogFormatter"
As I6a56c204 breaks extensions because of changing protected methods to public, this has to be reverted. We need a solid solution and the next 1.21-wmf is being branched tomorrow. Revert is the sanest solution at the moment.

This reverts commit 888fe0ffb3
2012-12-10 01:23:07 +00:00
jan
888fe0ffb3 (bug 24620) Add tests for LogFormatter
This change adds tests for LogFormatter. Tested are the normal log
params, the log params with type and the output of the comment.

Change-Id: I7218a1738c97db1d888605cecdfbffe21ca00fbf
2012-12-10 00:01:14 +00:00
jenkins-bot
32eec745d3 Merge "Set wgWellFormedXml for LinkerTest::testUserLink" 2012-12-09 19:54:08 +00:00
jenkins-bot
39351beea5 Merge "Set wgHtml5/wgWellFormedXml for XmlTests" 2012-12-09 16:35:19 +00:00
umherirrender
515253bc4c Set wgWellFormedXml for LinkerTest::testUserLink
Change-Id: I9ab370e2f23e0134741680ff620e8bb552496868
2012-12-09 11:56:45 +01:00
umherirrender
ee643dd587 Set wgHtml5/wgWellFormedXml for XmlTests
Change-Id: I3cab843bad9461098cf3c6b574fb767c3267ab14
2012-12-09 11:47:03 +01:00
umherirrender
45dea98358 Fix SanitizerTest for wikis with wgUseTidy = true;
testRemovehtmltagsOnHtml5Tags needs wgUseTidy = false;

3) SanitizerTest::testRemovehtmltagsOnHtml5Tags with data set #2
('time', false)

Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<time></time>
-'
+'<time>'

Change-Id: Ib7e156293e2efae053b055e40393e442719eb5bd
2012-12-09 11:03:03 +01:00
IAlex
073e1ccf7c Merge "ParserOutput::addLanguageLink needs a string" 2012-12-09 09:52:05 +00:00
IAlex
659ca077ba Merge "Adding missing @group Database to unit tests" 2012-12-09 09:37:32 +00:00
umherirrender
0fc445c19b Adding missing @group Database to unit tests
Reasons:
* Signature parsing
* GenderCache
* Using TestUser class (inside ApiTestCase)

Change-Id: Iea4e9f9cafaa3afe7da8b922644061d3d575afe3
2012-12-09 10:27:56 +01:00
Reedy
1bff6d7428 Remove unreachable lines
Change-Id: Ie7ec14f4ce65bc87b0cd49ec9266c394770ee7c4
2012-12-09 02:37:10 +00:00
daniel
d9cd65c902 Fix condition for the entries with a null model.
A null model means ‘guess from page name’.

Change-Id: I63e80761e46cc7707e9c862e2e50a950c1766aa4
2012-12-08 22:09:30 +01:00
Platonides
ab1c0eea37 The error message should refer to $wgContentHandlerUseDB
Change-Id: I81bc50e6949cecdc7f3d7e0b89f54464b4a146c7
2012-12-08 22:06:20 +01:00
jenkins-bot
067fe75c71 Merge "Remove broken test." 2012-12-08 18:54:01 +00:00
jeroendedauw
d528767567 Remove broken test.
Calling the method does not raise an exception but a notice (depending on settings).
PHPUnit just happens to turn this into an exception. The test thus breaks if PHPUnit
does not do this, which apparently happens in some cases and caused bug 41491

Change-Id: I9d14fd875c70c8b3d164c0b8a4fa2667c5769682
2012-12-08 19:26:40 +01:00
IAlex
d26f07888b Merge "worthwhile tests in testTitleObjectStringConversion" 2012-12-08 14:37:31 +00:00
jenkins-bot
08299be12d Merge "(bug 40585) Don't drop 'step="any"' in HTML input fields." 2012-12-08 12:47:07 +00:00
Brad Jorsch
13f0f58f76 (bug 42639) Fix API action=options for multiselect prefs
Preferences options using HTMLForm's "multiselect" type are stored in
the user preferences table as one key with a boolean value for each
option in the multiselect. The validation code added in change I98df55f2
does not take this into account, and therefore considers all of these
option keys invalid.

This changeset fixes that, and adds a unit test to verify correct
behavior.

Change-Id: I137c74a6045c7b39e2119a8edde2705738879bc9
2012-12-08 10:09:04 +01:00
Niklas Laxström
49b3acb7ee Less wild whitespace
Change-Id: I3048b23b50aa284b3471dfb8033122c913909b01
2012-12-07 21:44:53 +00:00
Platonides
896da321db hideDeprecated( 'CategoryPage::getAutosummary' )
check-vars correctly detects the call to CategoryPage::getAutosummary as
deprecated by coming from Article::getAutosummary but needs an explicit
hideDeprecated() to not complain about it.

Change-Id: I8a51a3041cc4cab592c5e37862efb69b538821a0
2012-12-07 22:43:02 +01:00
Platonides
a1e7329d8f Use JobQueueGroup::singleton()
Replaces usages of the deprecated pop() and insert()/insertBatch()
methods of Job class.

Change-Id: I5572c9e31a14bd660d7e3b9aa7792d0be9a26103
2012-12-07 20:30:45 +01:00
Tim Landscheidt
6dc4039270 (bug 40585) Don't drop 'step="any"' in HTML input fields.
The default value for "step" is "1" which effectively bans any decimal
number from being entered into an 'type="number"' field and makes
HTMLFloatField unusable.

Change-Id: I103fd4047814a7fb0dfdc174f36badd5b660b7a4
2012-12-07 19:26:29 +00:00
jenkins-bot
9911316d18 Merge "Remove code duplication" 2012-12-07 17:57:15 +00:00
jenkins-bot
0955a5787f Merge "Add the required call to the parent setUp to DiffHistoryBlobTest::setUp()" 2012-12-07 17:49:41 +00:00
Antoine Musso
92b4b7340b worthwhile tests in testTitleObjectStringConversion
The previous tests were not reflecting their comment, I have tweaked the
assertions a bit to actually test something that reflect the comments.

Change-Id: Ie1764ee1a218ead0169958704ba8625ab8d56445
2012-12-07 16:39:39 +01:00
umherirrender
e3cdd9b742 ParserOutput::addLanguageLink needs a string
The Parser passed a string, not a Title object to that method, doing
this in the test also

Change-Id: I05d195c1dc3cd2366795334f81601007240d9f33
2012-12-07 12:33:47 +01:00
Hashar
ace6ceaf48 Merge changes Ic85d486d,I95bfb886
* changes:
  Rename JavascriptContentTest to JavaScriptContentTest
  Use the canonical class name: s/JavascriptContent/JavaScriptContent/
2012-12-07 10:51:16 +00:00
jeroendedauw
e90d1a0918 (bug 42226) failure in sites tests
MediaWikiSiteTest::testRemove got a duplicate key error.

Change-Id: I7a40fe50b757e4162b7ccf1655d872cbd2c51f5d
2012-12-07 11:38:40 +01:00
Reedy
ffe431dc75 Remove code duplication
Remove trailing whitespace

Change-Id: I31b381c45ccc1631bd17c4d62a1cc1985a4770ba
2012-12-07 01:11:38 +00:00
Platonides
9a81302781 Rename JavascriptContentTest to JavaScriptContentTest
Better match the original class name.

Change-Id: Ic85d486d55c2bc58189e5d5b411d296e872fc577
2012-12-06 23:13:10 +01:00
Platonides
bbd5b3f786 Use the canonical class name: s/JavascriptContent/JavaScriptContent/
Change-Id: I95bfb8860f77d01bad027d1c2baf2d871e093758
2012-12-06 23:11:16 +01:00
umherirrender
fa1394e1a7 Add parent::setUp() to DatabaseSQLTest
1) DatabaseSQLTest::testMediaWikiTestCaseParentSetupCalled
DatabaseSQLTest::setUp() must call parent::setUp()
Failed asserting that an array has the key 'setUp'.

Change-Id: I6aa5cb09999e0cee9b36fedd9193cb5aa08914ad
2012-12-06 21:20:52 +00:00
Platonides
a8440314f2 LinkerTest needs to set the wiki language to en.
The localisation of Special:Contributions break the
testUserLink otherwise.

Change-Id: I25a40356a96e03975d8ceca975449f7b064bca2b
2012-12-06 18:53:43 +01:00
Platonides
bd5fff091c Add the required call to the parent setUp to DiffHistoryBlobTest::setUp()
Change-Id: I598064cc7690f8dcc2fc5ef7a5d7c75935566d26
DiffHistoryBlobTest::testMediaWikiTestCaseParentSetupCalled
 DiffHistoryBlobTest::setUp() must call parent::setUp()
2012-12-06 17:22:18 +01:00
Antoine Musso
5b9f76aef7 test: detects parent setUp not being called
Our test classes often overload MediaWikiTestCase::setUp() but forget to
call their parent. This patch makes MediaWikiTestCase to flag whenever
its own setUp() is called and then simply assert it got called. Any
class failing the assertion is missing a call to its parent setup which
is easily fixed by adding: parent::setUp().

It would be nice to find a similar trick for tearDown().

Change-Id: Ia2afed6052eb3863d6c8e68c551cf03b33bb4be9
2012-12-05 16:44:41 +01:00
Krinkle
25a01802d1 Merge "(bug 42638) Fix API action=options&reset=1 & unit tests" 2012-12-04 00:22:21 +00:00
Antoine Musso
bd6f3ddc6f test: raise timeout for DatabaseSqlite
DatabaseSqliteTest does file access and hence needs a slightly higher
timeout in PHPUnit.

Change-Id: I4b5eb7d7c5a3b9d4790f11cdb4efa9f578763183
2012-12-03 09:18:43 +01:00
Antoine Musso
2faf797e3a test: raise timeout for ExifRotation
ExifRotationTest does file access and hence needs a slightly higher
timeout in PHPUnit.

Change-Id: I871c4a4fde5e71708e55b3f28e7267e1023c2df5
2012-12-03 09:18:32 +01:00
Brad Jorsch
fb7c95f567 (bug 42638) Fix API action=options&reset=1 & unit tests
Change I98df55f2 broke action=options&reset=1, causing it to return an
error "No changes were requested" rather than resetting the options as
it should. Unfortunately, that change also broke the unit test that
would have caught this regression.

This changeset fixes the bug and the unit tests.

Change-Id: I7fe63640d54efab4572538e9d08f5b75c61243a4
2012-12-02 23:22:18 -05:00
Catrope
fe45ba8752 (bug 42202) Validate preference values in action=options
Previously, there was no validation whatsoever and the module would
happily write any preference you asked it to. This, combined with the
fact that the code using the 'editfont' preference didn't perform any
validation or escaping, led to a CSS injection vulnerability.

Using Preferences::getPreferences breaks some existing test cases
because a MockUser doesn't have groups for preferences.

Change-Id: I98df55f2b16ac1b6fce578798b6f58b5dad96775
2012-11-29 16:42:56 -08:00
Ori Livneh
55e064e3f8 Merge "Fix typo (sentances => sentences)" 2012-11-27 23:29:06 +00:00
Ori Livneh
237207bf0e Fix typo (sentances => sentences)
Change-Id: Ifaec0d0bd24703dbe80ab1869366b404aa001cce
2012-11-27 15:27:45 -08:00
Platonides
6e20a8c245 Fix $wgHtml5 case. Follow-up c35304 (0473c33)
Change-Id: Ie5916a5fbb64873adb0ed8a6fdd0aca666c7ebf1
2012-11-27 18:47:30 +01:00
Demon
c4d0ce4852 Merge changes Idfc2e2b6,I9b30d602
* changes:
  $wgHTML5 is a different variable than $wgHtml5 and the right name is the later.
  Global tweaks wrt $wgSecureLogin.
2012-11-27 17:18:21 +00:00