wiki.techinc.nl/tests/phpunit/includes
Timo Tijhof 8596a01658 phpunit: Make LogFormatterTest less slow
Right now it's quite slow because it reloads LocalisationCache
for every test case.

Change the reload to only happen once for the entire class.

Also use RequestContext instead of wgLang to match logic in
the parent class (MediaWikiLangTestCase).

$ phpunit includes/logging/LogFormatterTest.php
Before
- run 1) Time: 23.56 seconds, Memory: 48.00MB
- run 2) Time: 22.41 seconds, Memory: 48.75MB
After
- run 1) Time: 14.27 seconds, Memory: 47.50MB
- run 2) Time: 13.45 seconds, Memory: 47.25MB

Change-Id: Ia791563ca9094c36782acfe9826def45f2a1d621
2017-04-14 23:44:23 +00:00
..
actions Revert "Make an empty "?action=" parameter default to "view"" 2016-05-18 18:54:50 +00:00
api Merge "ApiPageSet: Follow RedirectSpecialArticle redirects" 2017-04-08 09:36:21 +00:00
auth phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
cache tests: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 02:14:34 +00:00
changes phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
composer Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
config Get ConfigFactory & MainConfig from MediaWikiServices 2016-11-23 00:12:38 +00:00
content phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
context Fix numerous class/function casing 2016-03-18 23:14:49 +00:00
db Move Database and subclasses to Rdbms namespace 2017-04-12 10:43:57 -07:00
debug phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
deferred Add accessor to DeferredUpdates 2017-03-03 13:32:05 +00:00
diff Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
exception Remove empty lines at end of functions 2016-11-05 11:55:10 +01:00
externalstore Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
filebackend Fix @covers for FileBackend 2017-02-27 19:12:22 +11:00
filerepo phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
GlobalFunctions Add missing @group Database tags in tests 2017-03-18 19:13:18 -04:00
htmlform Merge "HTMLForm: Allow returning Message objects from HTMLFormField::validate()" 2016-11-25 09:11:07 +00:00
http HttpFunctions: Increase code coverage 2017-03-29 00:27:57 +00:00
import Get ConfigFactory & MainConfig from MediaWikiServices 2016-11-23 00:12:38 +00:00
installer DatabaseUpdater: Stop inserting junk into 'updatelog' every time the updater runs 2016-11-30 20:13:30 +00:00
interwiki Removed deprecated usages of Interwiki methods in core 2017-01-10 12:19:31 +02:00
jobqueue phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
json Remove spaces after cast operators 2016-10-31 13:57:39 +00:00
libs phpunit: Avoid use of wmf-production host names 2017-04-12 02:53:33 +00:00
linker phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
logging phpunit: Make LogFormatterTest less slow 2017-04-14 23:44:23 +00:00
mail phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
media tests: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 02:14:34 +00:00
objectcache objectcache: Complete coverage for newAnything() 2017-04-10 14:52:04 -07:00
page tests: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 02:14:34 +00:00
pager Remove trailing empty lines in PHP 2017-01-16 22:06:43 +01:00
parser Fix @covers for (non-integration) parser tests 2017-02-27 15:47:56 +11:00
password Add missing @group Database tags in tests 2017-03-18 19:13:18 -04:00
poolcounter Include type in hashKeyIntoSlots() 2016-05-09 16:54:51 -07:00
rcfeed Add missing @group Database tags in tests 2017-03-18 19:13:18 -04:00
registration registration: Always specify version number in extension.schema.json file 2016-12-16 11:47:15 -08:00
resourceloader Merge "resourceloader: Add unit tests for ResourceLoaderImage" 2017-04-11 22:25:33 +00:00
search phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
Services phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
session phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
site phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
skins phpunit: Fix OutputPage::__construct warning in SkinTemplateTest 2017-02-08 18:19:43 +00:00
specialpage RCFilters: Remove isAllowedCallable and isAllowed 2017-03-31 01:49:44 -04:00
specials phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
tidy Merge "RemexHtml tidy driver with p-wrapping" 2017-03-08 15:24:36 +00:00
title Avoid database access in ImportTitleFactory tests dataProviders 2017-03-18 19:12:52 -04:00
upload SECURITY: Whitelist DTD declaration in SVG 2017-04-06 13:43:04 -07:00
user phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
utils Miscellaneous indentation tweaks 2017-02-27 19:23:54 +01:00
BlockTest.php tests: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 02:14:34 +00:00
CollationTest.php Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
DiffHistoryBlobTest.php Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
EditPageTest.php tests: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 02:14:34 +00:00
ExportTest.php DumpStringOutput: Rename getOutput() to __toString() 2016-07-14 06:28:16 -04:00
ExtraParserTest.php tests: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 02:14:34 +00:00
FauxRequestTest.php FauxRequest: Complete code coverage for FauxRequestTest 2017-04-01 01:25:02 +00:00
FauxResponseTest.php Fix numerous class/function casing 2016-03-18 23:14:49 +00:00
FormOptionsInitializationTest.php Remove "Generated by PHPUnit" comments in 3 files 2016-12-13 03:20:04 +00:00
FormOptionsTest.php Remove "Generated by PHPUnit" comments in 3 files 2016-12-13 03:20:04 +00:00
GitInfoTest.php Remove empty lines at end of functions 2016-11-05 11:55:10 +01:00
HooksTest.php Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
HtmlTest.php Html: Add a few @covers for HtmlTest 2017-03-31 18:13:24 -07:00
LicensesTest.php Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
LinkerTest.php bidi-isolate usernames in Linker::userLink 2016-08-31 17:44:06 -07:00
LinkFilterTest.php Move LikeMatch to Rdbms namespace 2017-02-06 21:20:39 -08:00
MediaWikiServicesTest.php phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
MediaWikiTest.php Revert "MediaWiki.php: Redirect non-standard title urls to canonical" 2016-09-09 21:45:27 +00:00
MediaWikiVersionFetcherTest.php
MergeHistoryTest.php Whenever possible, reuse User objects in unit tests 2016-05-26 20:42:31 +00:00
MessageTest.php SECURITY: Disable <html> tag on system messages despite $wgRawHtml = true; 2017-03-28 21:51:44 +00:00
MovePageTest.php Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
MWNamespaceTest.php Miscellaneous indentation tweaks 2017-02-27 19:23:54 +01:00
MWTimestampTest.php phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
OutputPageTest.php Ensure logo preload transforms urls if needed 2017-04-12 21:34:31 +00:00
PagePropsTest.php Remove empty lines at end of functions 2016-11-05 11:55:10 +01:00
PathRouterTest.php Swap the rest of array() -> [] 2016-03-30 22:04:58 +00:00
PreferencesTest.php tests: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 02:14:34 +00:00
PrefixSearchTest.php tests: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 02:14:34 +00:00
RevisionStorageTest.php Revision::getText() was removed 2017-01-19 01:57:38 +00:00
RevisionStorageTestContentHandlerUseDB.php Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
RevisionTest.php Revision::getText() was removed 2017-01-19 01:57:38 +00:00
SampleTest.php Update weblinks in comments from HTTP to HTTPS 2016-11-07 15:24:46 +01:00
SanitizerTest.php tests: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 02:14:34 +00:00
SanitizerValidateEmailTest.php tests: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 02:14:34 +00:00
SiteConfigurationTest.php Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
StatusTest.php tests: Fix invalid @covers value in StatusTest.php 2016-09-22 18:29:28 +01:00
TemplateCategoriesTest.php Remove empty lines at end of functions 2016-11-05 11:55:10 +01:00
TemplateParserTest.php Better path traversal prevention in TemplateParser. 2017-03-14 18:43:11 +00:00
TestingAccessWrapper.php Handle static access in TestingAccessWrapper 2016-01-24 22:24:10 -06:00
TestingAccessWrapperTest.php Handle static access in TestingAccessWrapper 2016-01-24 22:24:10 -06:00
TestLogger.php Add TestLogger::setCollectContext and fluent interface 2017-02-01 01:45:28 +01:00
TestUser.php Make deprecated TestUser properties private 2016-06-22 15:43:54 +00:00
TestUserRegistry.php Whenever possible, reuse User objects in unit tests 2016-05-26 20:42:31 +00:00
TimeAdjustTest.php Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
TitleArrayFromResultTest.php Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
TitleMethodsTest.php Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
TitlePermissionTest.php Remove "editusercssjs" user right 2017-04-11 14:54:43 +01:00
TitleTest.php tests: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 02:14:34 +00:00
WatchedItemIntegrationTest.php Merge "Remove missed WatchedItem::resetNotificationTimestamp in test" 2016-07-28 10:22:59 +00:00
WatchedItemQueryServiceUnitTest.php phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
WatchedItemStoreIntegrationTest.php add setNotificationTimestampsForUser to WatchedItemStore 2016-05-18 08:50:46 +00:00
WatchedItemStoreUnitTest.php phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
WatchedItemUnitTest.php phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat 2017-04-06 00:44:32 +00:00
WebRequestTest.php Move IP::isConfigured/TrustedProxy() to ProxyLookup service 2016-09-21 20:02:09 -07:00
WikiMapTest.php Improve WikiMap::getWikiReferenceFromWgConf() 2016-07-06 14:20:07 -04:00
WikiReferenceTest.php Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
XmlJsTest.php Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
XmlSelectTest.php Update weblinks in comments from HTTP to HTTPS 2016-10-11 17:25:10 +00:00
XmlTest.php Xml: Add test for listDropDown and remove unused getArrayFromWikiTextList 2017-03-20 22:47:19 +00:00