aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/content/JavaScriptContentHandlerIntegrationTest.php
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@cscott.net>2022-06-16 10:12:03 -0400
committerC. Scott Ananian <cscott@cscott.net>2022-07-28 10:45:35 -0400
commit008095280a7387b835a0aab9f00ab1d642ed9067 (patch)
treec9e2724435a4d933627515292db292fd87f1a926 /tests/phpunit/includes/content/JavaScriptContentHandlerIntegrationTest.php
parent83d9423743063ae6ecb033661f1dc75c0a540b08 (diff)
downloadmediawikicore-008095280a7387b835a0aab9f00ab1d642ed9067.tar.gz
mediawikicore-008095280a7387b835a0aab9f00ab1d642ed9067.zip
Use canonical parser options when rendering JavaScript/CSS for side effects
In the JavaScript and CSS content handlers we render the page "as wikitext" solely to generate categories, toc, etc, and then throw that output away and replace the generated HTML. Simplify the code paths and the caching by using the canonical options which don't split by user language, etc. Three minor issues with the current patch, which can hopefully be addressed in follow ups: 1. WikiPage::makeParserOptionsFromTitleAndModel() has a very cumbersome name and arguably doesn't belong in WikiPage in the first place. T313455 already exists to find a better place for this/way to do this. 2. Title::isConversionTable() requires a downcast of the page reference to a full title object. This method also probably wants to live somewhere else. 3. It really would be nice to combine this more properly with ContentHandler::getParserOutputForIndexing(), but that method uses a ParserOutputAccess object which requires a PageRecord, and we don't have a PageRecord available in fillParserOutput(). Bug: T307691 Change-Id: I081105741b507ed49e19cb878550ba4293e09413
Diffstat (limited to 'tests/phpunit/includes/content/JavaScriptContentHandlerIntegrationTest.php')
-rw-r--r--tests/phpunit/includes/content/JavaScriptContentHandlerIntegrationTest.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/phpunit/includes/content/JavaScriptContentHandlerIntegrationTest.php b/tests/phpunit/includes/content/JavaScriptContentHandlerIntegrationTest.php
index 5055b274f1aa..67cdd623a9ff 100644
--- a/tests/phpunit/includes/content/JavaScriptContentHandlerIntegrationTest.php
+++ b/tests/phpunit/includes/content/JavaScriptContentHandlerIntegrationTest.php
@@ -40,7 +40,9 @@ class JavaScriptContentHandlerIntegrationTest extends TextContentHandlerIntegrat
'expectedFields' => [
'Links' => [
],
- // Sections /should/ be empty as well: T307691
+ # T307691
+ 'Sections' => [
+ ],
],
];
}