Commit graph

1398 commits

Author SHA1 Message Date
Subramanya Sastry
5923105af1 Added nested-list tests for covering additional cases for Parsoid.
Change-Id: Ic0ea44a5d965bfd27b34a790f18ef29f2ac20d6a
2012-06-06 17:16:01 -05:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Demon
0593465614 Merge "[FileBackend] Purge Swift process cache before container delete for sanity." 2012-06-04 20:46:32 +00:00
Demon
10aa784a46 Merge "Use canonical class name. Include ORMRowTest.php" 2012-06-04 20:26:28 +00:00
Gabriel Wicke
f5790ba627 Improve / add two passing link tests
* Add a transition *** -> #** to an existing test
* Add a test for interrupted lists

Change-Id: I09b81099a7e8a8b08fefb194670f91648c3e077f
2012-06-04 13:36:18 +02:00
Gabriel Wicke
da0dd987ed Add passing test for padleft and padright as substr
This is a popular 'misuse' of the padleft/padright functions, which was not
tested in the main parser tests so far.

Change-Id: Icda02b34101c8c35b13c1e84d9f565867148d8d8
2012-06-04 11:29:59 +02:00
Platonides
92d6102e51 Inherit DumpTestCase from MediaWikiLangTestCase, since
backup_PageTest expect the ContentLanguage to be English
(backupTextPassTest and backup_LogTest also get the change,
but don't require it)

Change-Id: I8b3482df011bccd9fe520ba07c8b8d70de3b9dbb
2012-06-03 16:55:38 +02:00
Platonides
e4b2dea3c4 Use canonical class name. Include ORMRowTest.php
Change-Id: Ia6bc39492056bb3aa3a1a17097b71b70d1344e50
2012-06-03 15:22:31 +02:00
Aaron Schulz
bc789ee4e6 Merge "reverse text/sha1 output in export to match xsd" 2012-06-03 10:09:08 +00:00
Aaron Schulz
c20f708ffd Merge "PHP >= 5.4.0 started taking advantage of $limit optimization of wfDebugBacktrace(), which we weren't treating right." 2012-06-02 16:58:41 +00:00
Reedy
9aa347f430 Merge "Added base class for testing ORMRow deriving classes and added a mock implementation in order to test the abstract parent class itself" 2012-06-01 14:29:07 +00:00
Reedy
3dd7c90e42 Merge "Add BackupDumper to the tests AutoLoader and kill the register globals include vulnerability added in 8ba9856." 2012-06-01 09:55:32 +00:00
Platonides
4c7dc368a6 The 4th Database::select() parameter is the function name.
The ORDER BY should be at $options.
This was throwing errors in PHP 5.4 due to the array being
converted to a string down at Database.php:862

Fixes 50ee1d2

Change-Id: Ifb0fc70144242f25fc916fb8d380ed3e2d334fb9
2012-06-01 00:13:36 +02:00
Platonides
72bf1fb244 Add BackupDumper to the tests AutoLoader and kill the
register globals include vulnerability added in 8ba9856.

Change-Id: If7fa6d76c91daa44aa53e80ac39be4860a763723
2012-05-31 22:19:39 +02:00
umherirrender
4e20a471ad reverse text/sha1 output in export to match xsd
Change-Id: I84588e3d9692ee9eb7411b1e391abfc6c9ee89bf
2012-05-31 21:05:40 +02:00
Platonides
2e506c4809 PHP >= 5.4.0 started taking advantage of $limit optimization of wfDebugBacktrace(),
which we weren't treating right.

* $limit in wfDebugBacktrace() is the number of returned frames,
we thus need to take into account the wfDebugBacktrace() frame, which
is sliced from debug_backtrace().

* wfGetCaller() needs to add a level for itself.

* MWDebug::warning() was logging itself as the warning issuer,
which is useless (the call a few lines before was right, though)
MWDebugTest.php changed accordingly.

* Removed double call to wfGetCaller( $callerOffset + 1 )

* Documented the meaning of wfGetCaller() parameter

* Added unit test

Change-Id: Ief50f4c810bad8b03bb2bf9dc6d945d9acb29851
2012-05-31 17:32:33 +02:00
Tim Starling
57a9de62ea Merge "(bug 36839) Use mb_check_encoding() if available." 2012-05-31 12:36:19 +00:00
lupo
5b9731e08a (bug 36839) Use mb_check_encoding() if available.
This is not a real fix for the cause of the bug (which is a
pcre.recursion_limit that is far too low), but I do wonder
about the efficiency of using a regexp to test for valid
UTF-8 encoding. After all the regexp has to be compiled first
into a state machine.

Patch set 2: Php unit test for Language.checkTitleEncoding
Patch set 3: benchmark
Patch set 4: add benchmark for non-capturing subgroup in regexp, and
since that's faster than a capturing subgroup, use it in
checkTitleEncoding() in the regexp branch.
Patch set 5: use Tim's suggestion (once-only pattern) in the regexp
branch. Also add to benchmark.

Change-Id: I551f096921d4c9c57cbcb091b80ab5970ca86a9b
2012-05-31 14:21:36 +02:00
Max Semenik
aa305c06fe mobile sub-directories for mobile-related code
Move DeviceDetection.php and DeviceDetectionTest.php

Change-Id: Ia4aaf7ad499dd2021ef9d2ebf7f6d829e8fc4656
2012-05-29 16:48:28 +02:00
Platonides
d97b7d6bc1 tests covering WebRequest->getAcceptLang()
Change-Id: I981574e854bc43aba2bd5def7cb6b1b665c5b6ca
2012-05-29 14:45:34 +02:00
jeroendedauw
298c8b4786 Added base class for testing ORMRow deriving classes and added a mock implementation in order to test the abstract parent class itself
Patchset 2: attempt to fix sql error when using sqlite
Patchset 3: for great justice
Patchset 4: sqlite, not postgres... /facepalm
Patchset 5: joy, more sql divergence...
Patchset 7: handle inconsistencies in MWs database abstraction layer

Change-Id: I1948c4ad815008321801c93584eb249c1f597560
2012-05-28 17:35:05 +02:00
Gabriel Wicke
1a7f80b18b Add passing test for definition list with empty definition
Change-Id: I850f2389274aca76bab0b4a340a14af58e349b93
2012-05-25 15:38:28 +02:00
Aaron Schulz
6435a6e737 [FileBackend] Purge Swift process cache before container delete for sanity.
* Also tweaked some documentation.

Change-Id: I89369d6211de216193ae1d895356137cacded5d7
2012-05-25 03:41:12 -07:00
Platonides
9180ab0b7c Make it work in wikis not configured in English.
(hardcodes message values)
 php phpunit.php includes/WikiPageTest.php

Change-Id: I4b93d983f467fd281695be5ac778d30db0b09c17
2012-05-23 23:09:15 +02:00
Aaron Schulz
723b886429 [FileBackend] Avoid an extra RTT on Swift listing operations.
* Also tweaked timestamp tolerance in tests, intended for Swift
* Also made a few tweaks to speed up tests a bit

Change-Id: Ibdee36d3bf86089b027dc74bb2582acc1ab4b96b
2012-05-22 10:53:48 -07:00
daniel
fa132be893 fix for Ibe3e88fa: restoring doDeleteUpdates().
When generalizing LinksUpdate to DataUpdate and introducing
WikiPage::getDeletionUpdates(), WikiPage::doDeleteUpdates()
was removed, even though it was still used by Title::moveToInternal().

This patch restores WikiPage::doDeleteUpdates(), using the
new logic based on WikiPage::getDeletionUpdates() to implement it.

Change-Id: I12a49d5ca3ccb6bb9cbb63dde436bcf2a7d8a985
2012-05-18 18:58:21 +02:00
Tim Starling
78d0b3cfa8 Merge "Remove extra unneeded whitespace" 2012-05-18 04:57:44 +00:00
Aaron
957f09b8a4 [FileBackend] Added doQuickOperations() function for things like purging thumbnails.
* doQuickOperations() lets us do things like purge thumbnails as fast as possible.
  Stat calls, SHA1 checks, and RTTs in general are avoided. It also avoids the
  slowness of lazy population of thumbnail SHA1s in Swift (for those made by rewrite.py).
* Removed supportedOperations() to avoid the extra complexity.
* Made a few variable type and exception documentation cleanups.
* Cleaned up unit test file removal a bit and made some functions private.

Change-Id: I6922368c6af7752a6927d96402519132203108a1
2012-05-16 10:30:34 -07:00
Reedy
df7b1cc716 Merge "[IP] Added an IP::prettifyIP() function for displaying IPs." 2012-05-15 19:10:51 +00:00
Tim Starling
6e49b1a966 Merge "[FileBackend] Added support for concurrent file write operations." 2012-05-14 07:23:29 +00:00
Aaron Schulz
8c8b289955 Merge "Introducing LinksUpdateTest." 2012-05-13 17:24:34 +00:00
daniel
50ee1d23e5 Introducing LinksUpdateTest.
This test case is intended to test the updating of various links
tables using a LinksUpdate object, based on the information in
a ParserOutput object.

Patch set 3: Suggestions by Aaron:
             factored assertSelect() out into MediaWikiTestCase.
             Force sorting of result set under testing.

Change-Id: I2d01e67ee7396080a04e5dff637aca0dc159c65d
2012-05-13 17:07:10 +02:00
Timo Tijhof
a3ac0eb68f Fix qunit failure when run from https://intergration..
Change-Id: Ibc42bb34aae4af1fc472ac1f02056842d6a23f88
2012-05-13 01:16:11 +02:00
Timo Tijhof
498ef943dd Allow custom teardown/setup per module through Qunit.newMwEnvironment
- Instead of having newMwEnvironment only create an object with
  setup() and teardown() that is passed to module() which uses them.

  Also allow a module test to pass additional setup/teardown to run.
  Otherwise one would have to extend newMwEnvironment, this is
  simpler.

- Also added a few unit tests of the test runner's newMwEnvironment
  method itself. (also serves as document/example for how to use it)

- This changes the signature of QUnit.newMwEnvironment. Was only
  used in 2 places in core. Adding release notes just in case.

- Needed to fix a unit test breakage in mw.Uri

Change-Id: I2c17f4a309208276ab7bd2420b720c0d8e4bf328
2012-05-13 00:37:30 +02:00
robin
84b8ca9801 Remove extra unneeded whitespace
This whitespaces causes an extra empty paragraph between text and transcluding a special page.
When a heading precedes a transcluded special page, there is no difference and it's fine with or without this whitespace.

See for example http://incubator.wikimedia.org/w/index.php?title=Incubator:Sandbox&oldid=822299

Change-Id: I6b06006d921368619d3969660c244176344e8aff
2012-05-12 23:37:50 +02:00
Reedy
c68ca4228e Merge "Integrating mobile device detection class into MW core" 2012-05-11 22:50:35 +00:00
Aaron
456177bdee [IP] Added an IP::prettifyIP() function for displaying IPs.
Change-Id: I53b3fe70bd0091ef02740f2b8950c36a0e4cf32e
2012-05-11 10:53:14 -07:00
umherirrender
e9fa97f76e Add unit test for MWNamespace::isNonincludable
rename MWNamespace::isNonincludableNamespace
to MWNamespace::isNonincludable, because "Namespace" is already in the
class name

Change-Id: Ie982835c7dc84cb10c823996e5360cc1b342f704
2012-05-11 19:52:34 +02:00
awjrichards
8653accc60 Integrating mobile device detection class into MW core
Change-Id: Ic7bbeba746ea37a92c1df5dbaa1fb4fd08da130c
2012-05-09 14:28:16 -07:00
Aaron
23a0490b78 [FileBackend] Added support for concurrent file write operations.
* FS backends work via popen() and basic shell commands.
* Swift backends use the custom SwiftCloudFiles async features.
* Refactored storagePathsRead()/storagePathsChanged() to normalize the paths
  for correct dependency detection in FileOpBatch.
* Cleaned up SwiftFileBackend exception handling to make debugging easier.
* Added a quick and dirty performance testing script.
* Updated unit tests to include a run with parallelize=implicit.
* Improved file test failure output a bit.

Change-Id: I6a5ed743c30c598e0dd7301dbdb3631c460332fd
2012-05-09 05:37:41 -07:00
lupo
5d7ae11c57 (bug 35240) Fix mw.loader state machine.
Main changes:

* handlePending() correctly handles "missing" and "error" states
and propagates error states up the dependency tree.

* handlePending() is called whenever a module enters one of the
states "ready", "error", or "missing" (in execute() and
mw.loader.state()).

* load() filters out not only undefined modules, but -- by the logic of
the comment there -- also modules in state "error" or "missing".

Minor changes:

* recurse() renamed to sortDependencies(), also uses a hash for
unresolved now instead of an array.

* execute() was never called with the second parameter "callback", hence
I've removed it.

* simplified the "are all dependencies 'ready'?" test and moved it to
its own function.

The change comes with additional QUnit tests for mw.loader. If I run
these tests against the current mediawiki.js, several of them fail. In
particular test #86 ("mw.loader real missing dependency") is
instructive: if the server returns "missing" for a module, dependent
modules never progress beyond "loaded", and if there are jobs (from
mw.loader.using()) depending on such a missing module (directly or
indirectly), neither ready() nor error() is ever called.

Running the tests against the changed mediawiki.js in this change, they
all succeed for me.

Patchset 2: whitespace changes, $_GET instead of $_REQUEST in
testloader.

Patchset 3: XML::encodeJsVar() in testloader, deepEqual() in Qunit
tests.

Patchset 4: rebase

Patchset 5: Amend commit message only (typo)

Change-Id: Ia67edfc07fc9237def04ed13bb2cee16e519d7af
2012-05-09 11:01:19 +02:00
Catrope
90db14df05 Merge "Re-enable css @import unit tests" 2012-05-08 21:54:22 +00:00
Aaron Schulz
a9e028e5a8 [FileBackend] File locking fixes.
* Fixed unlocking logic in FSLockManager for case when an EX lock was made, then an SH one, and then the EX one was "unlocked"
* Avoid hiding useful unlink() warnings in FSLockManager
* Reduced locking use in test cleanup code
* Added a simple testLockCalls() test function
* Made a few cleanups & fixes to backend tests

Change-Id: I1110d9b537c450d9feca5a2fb35519c22435e81d
2012-05-08 01:51:57 -07:00
Aaron Schulz
4e5ce55027 Merge "Let tablesUsed imply needsDB in MediaWikiTestCase." 2012-05-07 22:59:22 +00:00
Aaron Schulz
bc2b3e055c Merge "Adding $this->tablesUsed to RevisionStorageTest." 2012-05-07 22:53:13 +00:00
daniel
479711159c Adding test case for basic WikiPage functionality, including database interaction.
New tests are added to avoid regressions when the ContentHandler facility
is introduced.

Changeset 3: use tablesUsed to allow database cleanup after test, as per
             Aaron's suggestion.

Changeset 4: use array_merge instead of +=.

Changeset 5: trying dumber rollback test to see of jenkins likes it better.

Change-Id: I0a9f8dfd30031baa4b12cc128a39059868149884
2012-05-07 14:57:30 -07:00
daniel
650e33efa4 Let tablesUsed imply needsDB in MediaWikiTestCase.
If the test says it uses database tables, then it needs the database.

And while we are at it, make the check for the test group declaration
more lenient.

Patch set 2: tweaked according to demon's comments.

Change-Id: Ib123745d45b85cebeab5ec87ea7d8227ec3d1dea
2012-05-07 14:56:33 -07:00
daniel
9b98d16996 Adding $this->tablesUsed to RevisionStorageTest.
This is a follow-up to I6934d03e (no 6414).

Declare tables in $this->tablesUsed to allow for database clenaup,
as Aaron suggested.

Change-Id: Iac05b0428b335879729f6d3b993eac0d3151429c
2012-05-07 14:46:25 -07:00
Hashar
4d6e05cad6 Merge "Adding tests for dumps" 2012-05-07 16:39:14 +00:00