wiki.techinc.nl/tests/phpunit/includes/parser
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
..
CacheTimeTest.php
CoreParserFunctionsTest.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
ExtraParserTest.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
LinkHolderArrayIntegrationTest.php
MagicVariableTest.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
MagicWordFactoryTest.php Deprecate MagicWordFactory::getSubstIDs 2023-11-13 11:10:24 +01:00
PageBundleJsonTraitTest.php
ParserCacheSerializationTestCases.php ParserOutput: Allow passing LinkTarget to title-related methods 2023-12-08 17:50:29 -05:00
ParserCacheTest.php Only cache expensive renderings 2023-11-30 20:56:12 +00:00
ParserMethodsTest.php parser: Move lang/dir and mw-content-ltr to ParserOutput::getText 2023-11-03 19:24:47 -04:00
ParserOptionsTest.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
ParserOutputTest.php ParserOutput: Allow passing LinkTarget to title-related methods 2023-12-08 17:50:29 -05:00
ParserPreloadTest.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
ParserTest.php Move user options related classes into its own namespace 2023-11-29 13:27:13 +01:00
PreprocessorTest.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
RevisionOutputCacheTest.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
SanitizerTest.php Drop Sanitizer::escapeIdReferenceList(), deprecated since 1.36 2023-09-27 22:40:23 +00:00
StripStateTest.php
TagHooksTest.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
validateParserCacheSerializationTestData.php Update 'validateParserCacheSerializationTestData' maintenance script 2023-09-07 20:37:36 +00:00