wiki.techinc.nl/tests/phpunit/includes
C. Scott Ananian 4b83285954 ParserOutput: Allow passing LinkTarget to title-related methods
Broadened the argument type to allow passing LinkTarget to:
* ParserOutput::addCategory()
* ParserOutput::addLanguageLink()
* ParserOutput::addLink()
* ParserOutput::addImage()
* ParserOutput::addTemplate()

This allows for a tighter interface with Parsoid's
ContentMetadataCollector class and avoids errors caused by passing the
wrong form of string title ("text" with spaces versus "dbkey" with
underscores).

There are a few performance problems remaining after this patch, which
only apply to use by Parsoid (not the legacy parser):

1. ::addLink() does inefficient db requests to fetch the page id for
each link if the optional $id parameter is not passed.  These lookups
should be deferred and a LinkBatch used.  (The legacy parser always
passes $id.)

2. ::addTemplate() similarly requires $page_id (and $rev_id) to be
passed, so is not currently usable by Parsoid.

3. ::addLanguageLink() uses Title::getFullText() which is not present
in LinkTarget and is currently implemented as a full Title lookup.
This is not an issue for the legacy parser, because it already has a
Title object so the lookup is a no-op, but could be improved for
Parsoid's use.

Bug: T296023
Change-Id: If21ec8563c8a619bdde7c0cb6534bb9009480a21
2023-12-08 17:50:29 -05:00
..
actions Bump codesniffer to 42.0.0 2023-09-27 15:06:32 -04:00
api tests: Use ::class for class name resolution 2023-12-06 20:51:14 +01:00
auth Move user options related classes into its own namespace 2023-11-29 13:27:13 +01:00
block Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
cache Bump codesniffer to 42.0.0 2023-09-27 15:06:32 -04:00
Category Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
changes Replace a few manually crafted assertTrue assertions 2023-11-23 09:38:48 +01:00
changetags Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
collation
CommentStore Use namespaced CommentStore and CommentStoreComment in tests 2023-12-04 12:45:14 +00:00
composer tests: Move test cases from /includes/ into sub folder 2023-09-13 00:09:05 +02:00
config Namespace Config-related classes under \MediaWiki\Config 2023-09-21 05:41:58 +00:00
content Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
db rdbms: Drop ILoadBalancer::getAnyOpenConnection() 2023-11-28 15:42:39 +01:00
debug MWDebug: Add support for native PHP warnings to "Console" 2023-10-19 17:13:12 -07:00
deferred ParserOutput: Allow passing LinkTarget to title-related methods 2023-12-08 17:50:29 -05:00
diff parser: Move lang/dir and mw-content-ltr to ParserOutput::getText 2023-11-03 19:24:47 -04:00
editpage Move StaticUserOptionsLookup to the MediaWiki\User\Options namespace 2023-11-29 14:08:40 -05:00
exception Test UserBlockedError 2023-11-02 13:20:11 +00:00
export tests: Move test cases from /includes/ into sub folder 2023-09-13 00:09:05 +02:00
ExternalLinks Replace a few manually crafted assertTrue assertions 2023-11-23 09:38:48 +01:00
externalstore
filebackend Namespace remaining files under includes/deferred 2023-11-22 10:08:53 -05:00
filerepo Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
GlobalFunctions Autofix spacing around commas 2023-10-25 01:08:44 +02:00
HookContainer
Html tests: Move test cases from /includes/ into sub folder 2023-09-13 00:09:05 +02:00
htmlform Refactor HTMLRestrictionsField to allow more restrictions to be added 2023-11-23 16:01:50 +00:00
http http: MultiHttpClient supports TelemetryHeadersInterface 2023-09-12 18:05:17 +02:00
import Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
installer
interwiki Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
jobqueue Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
language Move user options related classes into its own namespace 2023-11-29 13:27:13 +01:00
languages Autofix spacing around commas 2023-10-25 01:08:44 +02:00
libs Namespace remaining files under includes/deferred 2023-11-22 10:08:53 -05:00
linkeddata
linker Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
logging Support new block schema 2023-11-29 13:31:42 +11:00
mail Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
media Clean up DjVuImage::retrieveMetaData including shellbox support 2023-12-04 20:20:32 +11:00
Message
Navigation
objectcache
Output Merge "In OutputPage::addParserOutput, getText() before processing metadata" 2023-11-06 21:02:58 +00:00
page Merge "Replace a few manually crafted assertTrue assertions" 2023-11-30 12:45:42 +00:00
pager Switch to ICP in some easy cases 2023-09-26 21:05:16 +02:00
ParamValidator/TypeDef Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
parser ParserOutput: Allow passing LinkTarget to title-related methods 2023-12-08 17:50:29 -05:00
ParserOutputTransform parser: Move lang/dir and mw-content-ltr to ParserOutput::getText 2023-11-03 19:24:47 -04:00
password Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
Permissions IP Masking: Expire temporary accounts in 1 year 2023-11-09 15:11:48 +01:00
poolcounter Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
preferences Move user options related classes into its own namespace 2023-11-29 13:27:13 +01:00
profiler
rcfeed Namespace remaining 'specialpage' files under \MediaWiki\SpecialPage 2023-09-18 18:23:13 +01:00
registration Bump codesniffer to 42.0.0 2023-09-27 15:06:32 -04:00
Request Merge "ContentSecurityPolicy: Expose directives" 2023-11-15 20:11:33 +00:00
ResourceLoader CodexModule: Add unit test for code splitting 2023-12-01 00:52:23 +00:00
Rest
Revision Use namespaced CommentStore and CommentStoreComment in tests 2023-12-04 12:45:14 +00:00
search search: prefer user typed form when re-ranking a redirect to the top 2023-10-25 10:59:52 +02:00
session tests: Use TestingAccessWrapper::newFromClass in session tests 2023-12-06 21:01:03 +01:00
shell
site
SiteStats Convert numerous DB queries to use QueryBuilders 2023-10-09 19:06:53 +02:00
skins Introduce BlockMockTrait 2023-10-27 12:22:36 +00:00
sparql
specialpage RC Filters: Treat unnamed accounts as unregistered 2023-11-08 10:41:34 +01:00
specials tests: Define property in BlockListPagerTest 2023-12-06 21:28:54 +01:00
Status Minimize code duplication in StatusValue methods 2023-11-30 20:26:52 +00:00
Storage Use namespaced CommentStore and CommentStoreComment in tests 2023-12-04 12:45:14 +00:00
title Namespace remaining files under includes/deferred 2023-11-22 10:08:53 -05:00
upload
user Move StaticUserOptionsLookup to the MediaWiki\User\Options namespace 2023-11-29 14:08:40 -05:00
utils Merge "Replace a few manually crafted assertTrue assertions" 2023-11-30 12:45:42 +00:00
watcheditem Move user options related classes into its own namespace 2023-11-29 13:27:13 +01:00
WikiMap tests: Move test cases from /includes/ into sub folder 2023-09-13 00:09:05 +02:00
xml tests: Move test cases from /includes/ into sub folder 2023-09-13 00:09:05 +02:00
AutoLoaderTest.php
MediaWikiServicesTest.php Namespace Config-related classes under \MediaWiki\Config 2023-09-21 05:41:58 +00:00
MediaWikiTest.php Namespace remaining files under includes/deferred 2023-11-22 10:08:53 -05:00
MockServiceWiring.php
SampleTest.php
TestUser.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
TestUserRegistry.php Autofix spacing around commas 2023-10-25 01:08:44 +02:00