- These tests were written while @import was broken. Now that it bug 34669 is temporarily
fixed, we can re-enable the unit test to watch for regressions.
- See also bug 31676 which is still open.
- Added a "wait" parameter to the qunit
Change-Id: If9c2ce012dfe62e032ca4f62384237af0acc826c
This introduces tests for isCssJsSubpage, isCssOrJsPage, and isWikitextPage.
New tests are added to avoid regressions when the ContentHandler facility is introduced.
Change-Id: I68987490b01242cc0bcdc0d9dfaa99f1227f71a0
When the native support is not available, the test is not incomplete.
See also the DiffBlob test and xdiff.
Change-Id: I16c14efc3f24e4171a699390d99ca6509d6a28c8
The tests in PreferencesTest.php checking email things,
enable email to let the test run complete and not depend on the wiki
setting.
Change-Id: I21b34b31c52a10e0f4f6b918ee25d98a97ea5981
* Added directoryExists() function to check if a dir exists.
* Added getDirectoryList() and getTopDirectoryList() functions to list out subdirs.
* Added getTopFileList() function to list out immediate files in a dir. This wraps getFileList(), which was modified.
Change-Id: I087835f40d76c41f5d6af55b9a34a51e0f44a675
LinkBatch can also give subpages to the GenderCache and therefor it is
easier to do it always in GenderCache, than in LinkBatch and Title
Add unit tests for GenderCache
Change-Id: Ia936ff8bb639a197b0b3a8e07c97a66edd57dd10
I have created an API module for changing the preferences.
It allows resetting preferences (reset argument) and bulk changes
of preferences (change argument) in a format:
name1=value1|name2=value2
The change argument has a limitation imposed by the current API
implementation as it cannot accept | in values. There is
available a pair of arguments optionname and optionvalue, the
latter accepts values with |.
I have created optionstoken parameter in meta=userinfo to provide
a token. There is already preferencestoken there, but I would
like to have a consistent naming.
Change-Id: I0d6c654a7354ba77e65e338423952a6a78c1150f
Fix Title related tests that are the wrong way round (noticed by Daniel Kinzler
when creating more tests, and wondering why phpunit was making error messages
that didn't make any sense!)
public static function assertEquals($expected, $actual, $message = '',
$delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
Change-Id: I09aeb7cb7edb8e486ccf2f54673f91cd9704cd3b
The new --with-phpunitdir let us specify a git checkout of PHPUnit. That
will ease regression testing of the upstream new version. Usage is
straightforward:
Checkout PHPUnit from git as instructed on:
https://github.com/sebastianbergmann/phpunit#readme
Invoke our test suite with:
$ cd maintenance/tests
$ php phpunit.php --with-phpunitdir /path/you/just/checked/out
Change-Id: I8a9af0deac4dd74e3c8bde73535555c54ac83766
The patch adds an optional parameter |link= to the <gallery>
tag. This will allow for images to link to other pages and
externals urls instead of being hardlinked to the image file
that is displayed in the gallery.
Here are a couple of examples.
Link as WikiLink:
<gallery>
File:20120106_001.jpg|link=Main_Page
</gallery>
Link as absolute URI:
<gallery>
File:20120106_001.jpg|my caption|alt=my alt
text|link=http://bugzilla.wikimedia.org
</gallery>
this would cause the link on the thumbnails rendered by the gallery tag to link
to a custom page/url instead of the actual media/image.
a link should be an internal wiki link or an absolute uri as shown in the examples.
Change-Id: I21b276ad5c7a8df13b3a716957d23fd53c37d29e
- Converted ./tests/jasmine/spec/mediawiki.Uri.spec.js
to ./tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js
- expect('').toContain('') doesn't exist in QUnit, changed to
ok(''.indexOf('') >= 0), which is what Jasmine does internally.
- Some of the Jasmine expects()'s didn't have descriptions, added those
while at it.
- Cleaned up the 1 test that was already in QUnit added in
2d84f3191a.
- Cleaned up SpecRunner.html
Change-Id: Id7b498888e22576e8ff0636725191624add470d6
The Language::formatDuration() method introduced by this patch let us
easily render an amount of seconds for easier human reading.
$ maintenance/eval.php
> var_dump( $wgLang->formatDuration( 1000 );
string(25) "16 minutes and 40 seconds"
Also ran rebuildLanguage.php on Siebrands request
Change-Id: If287fb10e897d3d2374cf6eeae3bc5be00cdfc01
The MockOutputPage can be needed in various tests suite beside
GlobalFunctions. Seems to make sense to get it in its own class so we
can easily use it.
Change-Id: Icbb34db81e8cc8636d95f6326dd228bc74a741d7
especially the surprising start-of-line behavior. This test will
be used to implement matching behavior in Parsoid.
Change-Id: Ibfa13dfd2be2d62c285449cb090e2b112fe30f9b
PHPUnit has a timeout protection system which let us put tests in three
categories having different timeout (default: 1s, 10s, 60s). The timeout
only happens when using strict mode and having PHPUnit Invoker
installed.
Recently, the continuous integration server has been upgraded and the
PHPUnit Invoker was installed to let us run a serie of tests related to
dumping the database to XML. They do need some timeout system. Suddenly,
some tests started failing.
By default all tests are in the 1 second timeout group. Since we use a
sqlite backend and the server hard disk can get busy, some test can take
more than one second to execute.
This patch raise the default (small group) timeout to 2seconds and
explicitly define the value for the two other groups (medium and large)
using PHPUnit default values.
Change-Id: I2f5613b0c0215023c413dec8e84804175d8c8d6e
- Raise from 5s to 10s. Should fix the false positives that sometimes
happens in TestSwarm if a VM is being slow (especially IE6).
Change-Id: I4bc00b34040f5659c8456ce6978627c32497656d
- More tests, test comments
(This is the same as r114049.)
Patch set 2: Squash in missed test file
Change-Id: Icaf7fdd11499c64c42b46e442c158f22309345a7
Change 1:
* Delete any pre-existing block for the tests
* Renamed test function and fixed comment typo
Change-Id: I4804ccae81dd0455e9d3ddf48960c4b5cd6e4f5f
This add GRAMMAR support to the mediawiki.jqueryMsg module:
1. make jqueryMsg understand GRAMMAR(case insensitive)
2. mw.language get convertGrammar, can be overridden per language as in
php
3. Introduce resourceloader module ResourceLoaderLanguageDataModule
4. Language.php get a method to filter wgGrammerForms for the current
contentLanguage.
5. Qunit tests
6. This code was originally written in jsgrammar branch of svn and had
reviewed during the last slush time.
Change-Id: I90dd0b2f0cb30fd30539896c292829adc4fc7364
Includes testcase.
mw.Uri already supplied the protocol if it was missing and
document.location was set. Newly it also supplies the host (and port)
from document.location if that is set. That enables handling of
root-relative URls like "/some/path".
Changeset 2/3: rename test file from mediaWiki.Uri.test.js to
mediawiki.Uri.test.js.
Changeset 4: fix jasmine tests. Test for 'http:/foo.com' is now expected
to succeed, not throw an exception. The second test for
'foo.com/bar/baz' in strict mode is correct; that's parsed in strict
mode as a truly relative path.
Change-Id: Ibc4386ba40cffea9d30417ec2720114f6819ae1c
* Added $wgLanguageConverterCacheType global to control LC cache type. We can use it to enable direct apc use for language converter (to match the live hack).
* Added $wgLangConvMemc object, available via Setup.php
Change 1:
* Updated unit tests
* Minor documentation cleanup in DefaultSettings.php
Change-Id: Icd5dd28407e9759ce294c784ec41d9ca15c89616
Also add explicit Title::getPrefixedText() in
CoreParserFunctions::special, so that method does not rely on
Title::toString.
Change-Id: I1d041b11386bff15811e19de47a662e5ed7a2b07
- mw.html
* Adding test for mw.html.Raw
* Adding more tests for mw.html.element
- mw.util
* Minor coding style update (local variables)
* Updating mw.util.addPortletLink to not create its own "#mw-panel",
this was previously done for ./qunit/index.html (which has been
removed) but when ran on [[Special:JavaScriptTest/qunit]] it collides
with the existing "#mw-panel", so far didn't break anything but that
was purely lucky. This element is redundant so taking it out of the
html sample
* Removing redundant clean up, #qunit-fixture is automatically cleaned
after each test
Change-Id: Iaf9791ca3cdcac1b732c851cdecc8fcd9f96fdd8
Adding <bdi> to $htmlpairsStatic to allow using this tag.
Adds parser test case to confirm that <bdi> makes it through with 'lang' attribute.
This updated patchset also adds <bdi> to the attribute whitelist with the basic common attribute; allows 'lang' and such to get through.
Change-Id: Ib7e6553f017837cb1d49d5718e288228c17392c0
It wasn't actively maintained and has been made obsolete when
[[Special:JavaScriptTest/qunit]] was introduced, which actually uses
ResourceLoader, LocalSettings and the Skin. It was broken in some ways
already and adds no value. It was a quick hack that isn't needed
anymore.
Change-Id: I60098902cd1e736b08992890dce978c71b9b32b0
* changes:
PHPUnit preparations for tests of maintenance
Database dependency injection for BackupDumpers
Pulling in fix for superfluous header
TextPassDumper::initProgress pull in default value
Add tests for:
- action=block and action=unblock gettoken
- attempting to block or unblock a user with no token passed.
Patchset2: use a provider to have tests run against both 'block' and
'unblock' actions.
Change-Id: I686348ff4e2fe419c556acea2fa59dd203dc9440
That test has probably always been broken and use an invalid token. The
bug tracking brokenness is http://bugzilla.wikimedia.org/35646
Since the broken test is merged in master, that block the integration of
Jenkins and Gerrit by having any submitted patchset to be reported as
failling :-(
Root cause is https://gerrit.wikimedia.org/r/3434 which made the
Block/Unblock API to actually verify the token previously always
considered valid (bug 34212).
Change-Id: Iecf6b083163c214c734360b2f6d9b4bed8af07dc
Printer friendly version of article must encode URL in unicode.
- Patch originally written by Brion Vibber
https://bugzilla.wikimedia.org/attachment.cgi?id=9593
- introduces wfExpandIRI() global function, uses wfExpandIRI_callback.
- phpunit test.
Change-Id: I348b9f1d2ce65cb14f20d4a5751ac9359c8b8316
That will let us tests all the API tests by using PHPUnit group
filtering such as:
php phpunit.php --group API
Also cleaned some whitespaces
Patchset-4: skipped files that had only whitespace changes
Change-Id: I51e03d910521b061f505e3a9b11a08c7b95f1538
So far we've still been using ./tests/qunit/index.html in TestSwarm, today I've tested locally
to submit a url to SpecialJavaScriptTest instead and made a bunch of browsers join my swarm,
quite a few problems popped up. This commit fixes those issues so that we can actually use
SpecialJavaScriptTest in TestSwarm.
* Add QUnit configuration variable for TestSwarm's inject.js
In order to use TestSwarm, the urls that TestSwarm loads in clients that has
the QUnit test suite running on it need to include a little javascript.
This inject.js registers hooks with QUnit to listen for when the test suite finishes
and contacts the parent window (TestSwarm loads the qunit test suite url in an iframe)
to submit the results. Previously I included a copy of TestSwarm's inject.js in
./tests/qunit/data and in our testrunner.js a relative link to that.
However this is currently breaking because it is an outdated version. Updating brings
no good since someone else might use their own TestSwarm would could still run on an old
version etc. The TestSwarm submitted too always expects that it's own inject.js is used,
not some snapshot copy. I've removed the copy of it in MediaWiki and instead added a
configuration option to point to wherever the you want is located.
Also, since the old static index.html version of the unit test can't retrieve PHP based
content, this means TestSwarm submissions through the old static index.html are no longer
supported. Only through the new Special:JavaScriptTest from now on. I'll probably remove
the whole index.html soon-ish as it's getting quite annoying to maintain all that by hand,
and it's been superseded in everywhere imaginable now anyway. Even not used anymore by
intergration.mediawiki.org because that's been quiet since the Git-switchover.., and when
we update it, we can update it to point to the new SpecialPage instead.
* OutputPage::allowClickjacking() on SpecialJavaScriptTest/qunit.
When initially testing the TestSwarm setup to submit SpecialJavaScriptTest/qunit urls
(instead of the old ./tests/qunit/index.html) it was failing due to an iframe DENY.
This was a bit odd since `$wgBreakFrames = false;` by default, and although
`$wgEditPageFrameOptions = 'DENY';` by default, it wasn't obvious at all that that value
("DENY") is used for all OutputPages by default (as supposed to just action=edit and the
like). This is because OutputPage has mPreventClickjacking=true by default and when it's
true-ish it uses $wgEditPageFrameOptions for the X-Frame-Options.
* 'position' => true; for the mediawiki.tests.qunit.suites module.
QUnit has a hook for "done". Which is called when QUnit.start() is called and all queued tests
have been executed. QUnit.start() is automatically called on window.onload by QUnit.
TestSwarm uses QUnit's hook system to hook into the QUnit "done" event, and at that point
takes the stats, submits them to TestSwarm and go on with the next job.
When testing locally, I got semi-random failures reporting that only 0/0 tests were
successfully ran in IE6. This is because when QUnit.start (and consequently QUnit.done)
are first called, apparently no test suites had finished downloading and/or execution yet
(the bottom queue is asynchronous, and doesn't postpone domready nor window.onload).
When normally viewing Special:JavaScriptTest/qunit this doesn't break anything, because if
QUnit start/done is in the past and another module(), test(), or equal() etc. is called it just
picks up again and adds more results to the page and calls QUnit.done() again.
However in the case of the TestSwarm embed, it submits the results after the first done() and
cleans up the iframe. So I'm making mediawiki.tests.qunit.suites a blocking module instead, so
that there will only be one QUnit.start/done and that's the one that TestSwarm gets and after
which TestSwarm can safely garbage the iframe.
This means that basically all test suite modules and the original modules they are testing will
be loaded from the head. Shouldn't have any side effects, but might cause minor breakage in
future in modules that badly assume they're being put on the bottom.
I'm not considering that a bug in the test, it'll just help catch that bad code sooner :),
it's a test suite after all.
(Yay, my first Git commit to MediaWiki core)
Change-Id: I83f83377f2183b6deb4e901af602ac9a5628558b
This reverts the SpecialCachedPage and formatDuration sagas, with some collateral damage here and there. All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html
* Introduced Parser::killMarkers() based on the concept from StringFunctions. Used it in cases where markerStripCallback() doesn't make sense semantically, namely grammar, padleft, padright and anchorencode. Used markerStripCallback() in other cases.
* Changed headline unstrip order as suggested by P.Copp on bug 18295
* In CPF::lc() and CPF::uc(), removed the is_callable(). This was a temporary testing hack committed by me in r30109, which allowed me to do differential testing against a copy of the parser from before that revision.
* Set vars in return this.each loop. This is the defacto standard plugin structure
but somehow it slipped through this one (it's a 2 line wrapper, easy to miss).
* Added unit test (which failed before this commit)
* Fixes:
-- (bug 35294) jquery.byteLimit shouldn't set element specific variables outside the "return this.each" loop.