Commit graph

52 commits

Author SHA1 Message Date
Aaron Schulz
eeb4bd77e1 * FU r106752: de-uglified Setup.php by moving most of the b/c code into FileBackendGroup. Deferred registration of file backends and lock managers to the respective singleton() functions for the group objects.
* Refactored FileRepo::initZones() to require the specific zones; nothing was using it differently.
* Removed deleted zone check in deleteBatch(), a similar error will instead trigger with the initZones() call as needed.
* Added $wgLocalFileRepo comment.
* Updated tests.
2011-12-22 01:06:19 +00:00
Aaron Schulz
53f96171cc FU r106752: use "media-" instead of "images-" in container names. Long live books, video, 3D meshes, and animated holograms from the future! 2011-12-20 23:47:53 +00:00
Aaron Schulz
5275f9b097 Merged FileBackend branch. Manually avoiding merging the many prop-only changes SVN likes to sprinkle in (easy to spot from the change list). Did not add SwiftFileBackend.php as it still is in development. 2011-12-20 03:52:06 +00:00
John Du Hart
216d661d3b Bug 29524 - Rename RequestContext::getLang to getLanguage
I'll be amazed if this doens't break any tests.
2011-11-21 16:13:21 +00:00
Alexandre Emsenhuber
6efba66c04 Made setupGlobals() return the created context and use it instead of either global variables or recreating more instance of those classes 2011-11-10 12:49:10 +00:00
Sam Reed
6906724935 Add, update, tweak documentation
Fix document comment blocks

Tweak some returns
2011-10-26 03:45:13 +00:00
Daniel Friesen
7a1d3bf06a Followup r98056; Add to this screwed up NewParserTest phpunit stuff as well. 2011-09-26 02:04:17 +00:00
Max Semenik
02b2c6c8db Fix for r96344: explicitly set $wgExtensionAssetsPath during tests 2011-09-06 16:47:05 +00:00
Chad Horohoe
df19f6cdea Merge ParserTestStaticParserHook into ParserTestParserHook since they practically do the same thing. 2011-09-06 14:46:58 +00:00
Alexandre Emsenhuber
062e2723ba Some misc fixes to tests:
* Don't create a WebRequest instance to put in $wgRequest in test since it is meant for HTTP requests, not command line ones
* Force $wgAlwaysUseTidy to false in ExtraParserTest, having it to true breaks testBug8689() and testParse()
2011-08-16 15:17:35 +00:00
Chad Horohoe
5f8e4b019b Move the fuzz test into @group Broken so it will shut up about being incomplete 2011-08-09 16:13:56 +00:00
Alexandre Emsenhuber
762c3f8204 * Call Linker methods statically
* Use INSERT IGNORE for the site_stats row (as for the interwiki entries); was throwing query error about duplicate row on my installation
2011-08-05 15:17:19 +00:00
Chad Horohoe
04b80879ce Partial fix for r88772: no need for IGNORE on site_stats, just interwiki 2011-08-04 23:14:17 +00:00
Sam Reed
66e01d1bb7 Adding __METHOD__ to parameters passed to wfMkdirParents() 2011-07-25 22:01:19 +00:00
Chad Horohoe
d80b53f982 self rv r90483. Still needs investigating though 2011-07-21 22:04:55 +00:00
Alexandre Emsenhuber
f82b49e02b Pass the Title object to Parser::transformMsg() 2011-06-29 10:58:54 +00:00
Chad Horohoe
d12cc8a163 Mark test incomplete for a legitimate reason like trying to serialize a PDO object--rather than imaginary ones such as blaming memory_limit being too low when the test was being stupid and lowering it for us. 2011-06-20 20:24:53 +00:00
Platonides
efbd16e825 Copy teardownUploadDir(),deleteFiles(),deleteDirs() from parserTest.inc Move down teardownGlobals()
This almost fixes the issue of hundreds of leaking mwParser-*-images files at temp dir.
For some unknown reason, there's still one instance left, though.

PS: I thought I had committed this time ago...
2011-06-16 21:07:37 +00:00
Chad Horohoe
c954cb7a4c * Remove @static from the last few places it's left in core. Please don't use this silly annotation anymore, that's what the static keyword is for.
* Enforce protected on SpecialAllPages::getNamespaceKeyAndText(), it's not @private like the comment implies
* Drop User::getMaxID(), nothing uses it
2011-06-14 01:56:55 +00:00
Happy-melon
295f513e8b More unpicking of r85288. I think this is all of the magic method calls, but they're very hard to grep for (part of the problem with them!), so let's leave the calls in with a wfDeprecated() for a while... 2011-06-03 11:04:49 +00:00
Antoine Musso
dacec03bde really add NewParserTest to the Stub group
PHPUnit 5.3.13 does not like having comments after the '@group name' command.
This class was not part of the Stub group and run despite the exclusion of
the Stub group in our suite.xml

Properly fix issue described in r89223 and complete r89226
2011-05-31 20:35:35 +00:00
Chad Horohoe
b7bc5a8db5 Workaround for duplicate key errors 2011-05-25 00:49:51 +00:00
Happy-melon
8ff0177e98 Follow-up r85403: rm unwanted "new" declaration. 2011-05-23 18:57:30 +00:00
Alexandre Emsenhuber
236e3fd6c6 Follow-up r88653: removed the remaining of OutputPage's stubbing 2011-05-23 17:53:31 +00:00
Happy-melon
21813a563c Follow-up r86775: restub $wgLang. Not because it's a good idea, but because I can't see how to avoid the circular dependencies on it *without* stubbing it. Probably easier to just continue the drive to deprecate the global variable altogether. 2011-04-24 10:50:51 +00:00
Happy-melon
c80535ae10 Stop stubbing $wgLang and $wgContLang. There are no major code paths which do not call either $wgLang or $wgContLang at least once. All index.php calls unstub $wgContLang from MediaWiki::parseTitle() except in the edgecase of viewing pages referenced only by "curid=123", and since those will end up calling OutputPage::output() they will eventually be unstubbed at some point as well. All calls through load.php unstub $wgLang in ResourceLoaderContext::getLanguage() from ResouceLoader::respond() --> ResourceLoader::preloadModuleInfo(). All calls through api.php unstub $wgContLang in ApiResult::cleanUpUTF8() from ApiMain::printResult(). 2011-04-23 15:19:38 +00:00
Platonides
c878cd608f r85553 fixup. When there are variants involved, the line
$GLOBALS['wgContLang'] = $context->lang;
is not assigning $wgContLang the same $langObj instantiated a couple of lines above, but a different object obtained from the user code, breaking variant parsertestsw..
2011-04-06 21:36:07 +00:00
Happy-melon
f121f89674 Follow-up r85403: fix fatal in parser tests. 2011-04-06 17:39:18 +00:00
Happy-melon
625695317e Follow-up r85302: update OutputPage constructors in core. 2011-04-05 00:06:47 +00:00
Antoine Musso
8012c3b188 debugging statement when starting a phpunit parser test 2011-03-18 21:45:32 +00:00
Platonides
95f1076f20 Remove unused globals 2011-03-06 23:28:32 +00:00
Chad Horohoe
b661588c1f Followup r83140: FakeMemCachedClient -> EmptyBagOStuff in tests 2011-03-03 12:55:22 +00:00
Tim Starling
be76d86932 * Rewrote ObjectCache.php to conform to the modern coding style, and to be less convoluted about how CACHE_ANYTHING and CACHE_ACCEL are resolved. Moved most functionality to static members of a new ObjectCache class.
* Moved the global functions to GlobalFunctions.php, where they are now just convenience wrappers. Made them return non-references. Updated callers (none found in extensions). 
* Added an advanced configuration method, $wgObjectCaches, which allows a lot more detail in the object cache configuration than $wgMainCacheType. 
* Made all object cache classes derive from BagOStuff. 
* Split the MWMemcached class into a generic client class and a MediaWiki-specific wrapper class. The wrapper class presents a simple BagOStuff interface to calling code, hiding memcached client internals, and will simplify the task of supporting the PECL extension.
* Added some extra constructor parameters to MWMemcached, configurable via $wgObjectCaches.
* Removed the *_multi() methods from BagOStuff, my grepping indicates that they are not used.
* Rewrote FakeMemCachedClient as a BagOStuff subclass, called EmptyBagOStuff.
* Added an optional "server" parameter to SQLBagOStuff. This allows the server holding the objectcache table to be different from the server holding the core DB.
* Added MultiWriteBagOStuff: a cache class which writes to multiple locations, and reads from them in a defined fallback sequence. This can be used to extend the cache space by adding disk-backed storage to existing in-memory caches.
* Made MWMemcached::get() return false on failure instead of null, to match the BagOStuff documentation and the other BagOStuff subclasses. Anything that was relying on it returning null would have already been broken with SqlBagOStuff.
* Fixed a bug in the memcached client causing keys with spaces or line breaks in them to break the memcached protocol, injecting arbitrary commands or parameters. Since the PECL client apparently also has this flaw, I implemented the fix in the wrapper class.
* Renamed BagOStuff::set_debug() to setDebug(), since we aren't emulating the memcached client anymore
* Fixed spelling error in MWMemcached: persistant -> persistent
2011-03-03 09:37:37 +00:00
Platonides
e82b7e169c Remove NewParserHelpers.php and use instead the original TestFileIterator from which it was copied in r79411.
Remove the $this->parserTest checks as r79411 did. They are no longer needed. They were here since 
TestFileIterator addition in r62006 back when this file was called parserTests.inc, before being renamed twice 
without preserving history.
The wfDie(); wasn't intended to fall into trunk. It was marking a dead branch and got committed by error in r76149.
2011-02-26 23:45:35 +00:00
Platonides
2e33fb3ff6 Finally commit the testing stuff I have been with this week. Could be considered a continuation of r79411.
Mixture of the NewParserTests.php with old code present in MediaWikiParserTest.php, reverting r79184 (revert of a revert...) and even eval().
Using the iterator as dataProvider, but defering the insertion of articles, as the dataprovider is processed on load, before switching dbs.
Each parser test appear now as a phpunit test. This means that by adding 683 tests (partly from extensions) we now surpass two thousand tests.
The downside of that is that they become painfully slow.
Initialise $wgHooks to $wgHooks, not to array() (r82499) as otherwise we lose ParserFirstCallInit registrations.
There's no attempt to support extensions registering to $wgParser instead of using ParserFirstCallInit properly (Cite falls in this category).
2011-02-26 21:49:42 +00:00
Platonides
32a37f873d Break the self-reference between parser and preprocessor, so they can be counting collected.
Saved a couple of Mb in the destructive make (126.25Mb -> 124.25Mb).
2011-02-20 00:27:01 +00:00
Platonides
bee16714e0 Save and restore $wgHooks in NewParserTest.
ParserGetVariableValueTs hook still being set to ParserTest::getFakeTimestamp was the reason for the crazy failures of MagicVariableTest inside phpunit that I was seeing.
2011-02-20 00:13:26 +00:00
Platonides
db7d7ebd28 Don't use ob_start/ob_get_contents/ob_end_clean just to var_dump() a string. Cleaning var_dump() usage. 2011-02-09 17:21:39 +00:00
Alexandre Emsenhuber
51c6afc751 * Replaced $wgMessageCache by MessageCache::singleton(); since we only use one instance of this class (as for ParserCache, LinkCache)
* MessageCache::singleton() calls wfGetMessageCacheStorage() directly instead of using $messageMemc, just in case this would be called before that variable is set
* Per TimStarling: also removed deprecated methods in MessageCache class: addMessages() and related, [get|set|enable|disable]Transform(), loadAllMessages(), loadMessageFile() and some others. Same for the legacyData stuff in LocalisationCache that was only used by MessageCache::addMessages() and related. 
* Converted remaining extensions
2011-01-26 15:42:04 +00:00
Chad Horohoe
38babb25b5 More silly whitespace 2011-01-10 18:43:59 +00:00
Chad Horohoe
c12dcf7101 rm big whitespace 2011-01-10 18:41:31 +00:00
Platonides
fa08f3be62 $messageMemc is used as local variable in line 63, function setUp
$messageMemc is used as local variable in line 74, function setUp
2011-01-05 23:54:07 +00:00
Sam Reed
da2c995df1 Remove unreachable return;
Add missing global $IP;
2011-01-03 03:40:26 +00:00
X!
9012b54101 Mark broken parser tests as broken 2011-01-03 02:49:52 +00:00
X!
1b4c6a0254 Fix r79447: Remove debugging code 2011-01-01 22:19:22 +00:00
X!
27618d012b Followup r79443: Add some form of organization to the test autoloader 2011-01-01 22:16:54 +00:00
X!
c667c3f1be Reorder functions around, add some form of order to the test suite.
It'd be nice to break some of these functions out to another class, but then again, 
I'd also like to see Windows actually become stable, MediaWiki to become fully class based, 
and Google to stop taking over the world. We can't all have what we want.
2011-01-01 20:57:13 +00:00
X!
2b8f832da8 Add fuzz tests to new parser tests (someone else should make sure this works as expected) 2011-01-01 18:10:28 +00:00
X!
37279160f3 Don't use the --verbose option anymore 2011-01-01 17:05:08 +00:00
X!
332e01addf Add parsertest specific help to PHPUnit.php 2011-01-01 06:49:00 +00:00