wiki.techinc.nl/tests/phpunit/includes
Brian Wolff bec8dada48 Clarify generate-html and make ParserOutput behave as expected
Previously:
* It was unclear that generate-html is an optional optimization
* Most of MediaWiki core was doing $parserOutput->setText('') if
html wasn't generated. However this is wrong and will cause
$parserOutput->hasText() to return true and also potentially cause
cache pollution if a content handler both does that and supports
parser cache (Like MassMessage; see T299896)
* The default value of mText in the constructor was '', and most
of the time MW used that default. This doesn't seem right. If
setText() is never called, the ParserOutput should not be considered
to have text
* It was impossible to set mText to null, as $parserOutput->setText(null)
was a no-op. Docs implied you were supposed to do this, so it was very
confusing.

This patch clarifies docs, changes the default value for ParserOutput::$mText
from '' to null, and makes $parserOutput->setText(null) do what you
expect it to. The last two are arguably breaking changes, although
the previous behaviours were unexpected, mostly undocumented and
based on a code search do not appear to be relied on.

It seems like the main reason this only broke MassMessage is most
content handlers either don't support generateHtml, or they don't
support parser cache.

Bug: T306591
Change-Id: I49cdf21411c6b02ac9a221a13393bebe17c7871e
Depends-On: I68ad491735b2df13951399312a4f9c37b63a08fa
2022-05-03 11:23:08 +02:00
..
actions TempUser UI tweaks 2022-04-26 14:34:08 +10:00
api Merge "Remove usage of protection related deprecated Title function" 2022-04-14 22:08:40 +00:00
auth Add convenience methods for asserting status. 2022-03-16 22:44:25 +01:00
block Clean up tests that misused the parameters of assertSame/Equals 2022-02-08 07:21:10 +00:00
cache tests: Change use of AtEase to at operator 2022-02-24 21:29:51 +00:00
changes tests: Change use of AtEase to at operator 2022-02-24 21:29:51 +00:00
changetags Handle null in ChangeTags::modifyDisplayQuery 2022-03-04 11:12:14 +01:00
collation phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00
config Clean up tests that misused the parameters of assertSame/Equals 2022-02-08 07:21:10 +00:00
content Clarify generate-html and make ParserOutput behave as expected 2022-05-03 11:23:08 +02:00
context context: Add a cached RequestContext::getActionName method 2022-03-25 12:12:48 +00:00
db rdbms: make automatic connection recovery more robust 2022-04-14 11:09:31 +10:00
debug DeprecationHelper: Fix method name in deprecation message 2022-04-11 23:30:06 +00:00
deferred Use new namespace for revision related classes 2022-04-14 23:03:43 +02:00
diff Merge "diff: Fix small issues and compact syntax in DifferenceEngine" 2022-02-04 15:09:28 +00:00
editpage editpage: Replace usage of Title in TextboxBuilder::class 2021-09-20 10:24:00 +01:00
exception Use HTTP 404 for BadTitleErrors instead of HTTP 400 2022-02-27 00:08:58 -08:00
externalstore Remove unneeded uses of MediaWikiCoversValidator 2021-05-22 01:43:29 +00:00
filebackend Add convenience methods for asserting status. 2022-03-16 22:44:25 +01:00
filerepo Add convenience methods for asserting status. 2022-03-16 22:44:25 +01:00
GlobalFunctions Refactor URL-parsing global functions to class 2022-04-12 15:14:35 +03:00
HookContainer phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00
htmlform Merge "HTMLForm: Add test for CSRF token check" 2022-02-21 16:19:03 +00:00
http tests: Use ::class in assertInstanceOf function 2022-01-16 21:17:09 +01:00
import phpcs: Disable Generic.Files.LineLength for test files 2022-02-18 18:32:05 +00:00
installer Installer: Do not use mediawiki.skinning.interface module 2021-04-15 11:11:32 -07:00
interwiki Optimise Skin::getLanguages() 2022-02-08 22:34:15 +00:00
jobqueue RefreshLinksJob: assert proper title 2022-02-09 20:39:08 +01:00
language phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00
languages phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00
libs Remove misleading test in SerializationTestTrain::validateObjectEquality() 2022-03-31 09:50:51 -04:00
linkeddata build: Updating dependencies 2021-07-22 03:36:05 +00:00
linker linker: Start of LinkTargetStore 2022-03-02 14:56:30 +00:00
logging logging: Normalize "infinity" in BlockLogFormatter for pre-T241709 rows 2022-04-12 20:57:18 +00:00
mail Remove access to config globals from more classes 2022-04-28 18:36:28 +03:00
media phpcs: Disable Generic.Files.LineLength for test files 2022-02-18 18:32:05 +00:00
Message Add Message/MessageValue user group member parameter type 2021-11-16 11:24:35 -05:00
Navigation
objectcache objectcache: remove "multiPrimaryMode" DB type assertion 2022-04-21 16:20:39 -07:00
page Use new namespace for revision related classes 2022-04-14 23:03:43 +02:00
pager pager: Improve Y2K38 check to keep leading zero in 3-digit years 2022-04-13 19:52:19 +02:00
ParamValidator/TypeDef Remove or replace usages of "sanity" 2021-11-21 19:35:49 +00:00
parser Clarify generate-html and make ParserOutput behave as expected 2022-05-03 11:23:08 +02:00
password Add convenience methods for asserting status. 2022-03-16 22:44:25 +01:00
Permissions Don't consult ActionFactory for pages that can't exist 2022-04-29 08:54:29 -04:00
poolcounter Change ParserOutputAccess workers to work with Status objects 2022-04-08 15:47:59 +02:00
preferences Fix SignatureValidatorFactory circular dependency 2022-04-13 12:38:00 +10:00
rcfeed rcfeed: Deprecate $wgRCEngines and RCFeedEngine 2022-03-08 19:50:19 +00:00
registration Integration test for extension registration 2022-03-11 21:43:41 +00:00
resourceloader Apply logo variant override in ResourceLoaderSkinModule 2022-03-28 13:22:07 +08:00
Rest Use updated ObjectFactory namespace 2022-03-09 23:04:51 +00:00
Revision IResultWrapper::next() now returns void 2022-05-02 10:43:51 +03:00
search phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00
session BotPasswordSessionProvider: inject GrantsInfo 2022-04-12 18:48:48 +02:00
shell Remove or replace usages of "sanity" 2021-11-21 16:42:31 +00:00
site phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00
skins Skin::makeLink: support tooltips on unlinked text 2022-04-07 12:45:49 +10:00
sparql sparql: Replace deprecated Http::userAgent() in SparqlClient 2021-08-04 13:54:13 +00:00
specialpage phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00
specials TempUser UI tweaks 2022-04-26 14:34:08 +10:00
Storage TempUser EditPage and permissions 2022-04-26 14:10:53 +10:00
title mediawiki.Title: Treat U+FFFD (replacement character) as invalid 2022-03-27 20:53:42 +00:00
upload Add us-ascii to safeXmlEncodings 2022-04-27 09:59:49 +10:00
user TempUser EditPage and permissions 2022-04-26 14:10:53 +10:00
utils Add convenience methods for asserting status. 2022-03-16 22:44:25 +01:00
watcheditem Add more support for read new in links migration 2022-04-12 02:22:17 +02:00
ActorMigrationTest.php phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00
ActorMigrationTest.sql Schema migration for revison_actor_temp table removal 2021-07-14 08:29:04 +10:00
AutoLoaderTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
CategoryTest.php Add getMemberCount() to Category to supersede getPageCount() 2022-01-31 13:59:34 +01:00
CommentStoreCommentTest.php
CommentStoreTest.php tests: Change use of AtEase to at operator 2022-02-24 21:29:51 +00:00
CommentStoreTest.sql
ContentSecurityPolicyTest.php phpcs: Disable Generic.Files.LineLength for test files 2022-02-18 18:32:05 +00:00
EditPageConstraintsTest.php Remove or replace usages of "sanity" 2021-11-21 19:35:49 +00:00
EditPageTest.php Add convenience methods for asserting status. 2022-03-16 22:44:25 +01:00
ExportTest.php Suppress deprecation warnings from libxml_disable_entity_loader() 2022-01-21 14:03:12 +11:00
ExtraParserTest.php phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00
FauxRequestTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
GitInfoTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
HooksTest.php phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00
HtmlTest.php Drop messagebox, warningbox, errorbox classes 2022-04-11 17:40:04 +00:00
LinkerTest.php Revert "WatchedStore requires PageIdentity" 2022-03-30 16:18:10 +00:00
LinkFilterTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
MagicWordFactoryTest.php tests: Change use of AtEase to at operator 2022-02-24 21:29:51 +00:00
MediaWikiServicesTest.php
MediaWikiTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
MediaWikiVersionFetcherTest.php
MergeHistoryTest.php Add convenience methods for asserting status. 2022-03-16 22:44:25 +01:00
MessageTest.php Only apply transformations for &uselang=qqx when actually using it 2022-03-08 01:50:44 +00:00
MockServiceWiring.php
MovePageTest.php Remove fallback to MediaWikiServices in MovePage::__construct 2022-04-20 21:06:44 +00:00
MultiHttpClientTest.php Fix deprecation warning from CURLPIPE_HTTP1 2022-01-25 14:35:41 +11:00
MWTimestampTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
OutputPageTest.php Apply logo variant override in ResourceLoaderSkinModule 2022-03-28 13:22:07 +08:00
PagePropsTest.php Hard deprecate PageProps::getInstance() 2022-03-15 22:58:48 +01:00
SampleTest.php phpcs: Disable Generic.Files.LineLength for test files 2022-02-18 18:32:05 +00:00
SiteStatsTest.php Replace deprecated JobQueueGroup::singleton() 2022-01-27 21:37:50 +01:00
StatusTest.php Add convenience methods for asserting status. 2022-03-16 22:44:25 +01:00
TemplateCategoriesTest.php tests: Make sure deferred updates are done and re-enable TemplateCategoriesTest 2022-03-17 13:01:08 +00:00
TestUser.php Create new UserGroupManager::addUserToMultipleGroups method 2021-08-30 10:24:46 -04:00
TestUserRegistry.php
TimeAdjustTest.php phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00
TitleTest.php SECURITY: Add recursion guard to Title::newMainPage() 2022-03-31 22:58:38 +01:00
TitleUrlTest.php Introduce TitleUrlTests 2021-09-08 07:48:45 +00:00
TrackingCategoriesTest.php Move ::addTrackingCategory() implementation to TrackingCategories 2021-10-15 14:17:58 -04:00
WebRequestTest.php Add wiki-farm support 2022-04-01 14:29:22 +02:00
WikiMapTest.php Replace usages of deprecated wfWikiID() 2021-12-21 02:05:55 +00:00
XmlTest.php phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00