Hard-deprecate ParserOutput stateful transform methods
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 22 Nov 2017 23:12:40 +0000 (18:12 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 13 Feb 2018 17:28:36 +0000 (12:28 -0500)
This also removes all the in-core calls that had been kept for the
benefit of extensions, and causes them to not have any effect since
anything that had been calling them was already either a no-op or will
probably be broken now that nothing in core is setting or checking the
flags.

Change-Id: Id22c1a5a6d6a249debb14063ae3f8838d105b634

14 files changed:
includes/EditPage.php
includes/OutputPage.php
includes/api/ApiParse.php
includes/cache/MessageCache.php
includes/diff/DifferenceEngine.php
includes/installer/Installer.php
includes/page/Article.php
includes/parser/Parser.php
includes/parser/ParserCache.php
includes/parser/ParserOptions.php
includes/parser/ParserOutput.php
includes/specials/SpecialUndelete.php
tests/phpunit/includes/parser/ParserOptionsTest.php
tests/phpunit/includes/parser/ParserOutputTest.php

index 6fbeed7..cdf2106 100644 (file)
@@ -4028,7 +4028,6 @@ ERROR;
                        $this->mTitle, $pstContent, $user );
                $parserOutput = $pstContent->getParserOutput( $this->mTitle, null, $parserOptions );
                ScopedCallback::consume( $scopedCallback );
-               $parserOutput->setEditSectionTokens( false ); // no section edit links
                return [
                        'parserOutput' => $parserOutput,
                        'html' => $parserOutput->getText( [
index 6b44a55..d210da4 100644 (file)
@@ -287,11 +287,6 @@ class OutputPage extends ContextSource {
         */
        private $mEnableTOC = false;
 
-       /**
-        * @var bool Whether parser output should contain section edit links
-        */
-       private $mEnableSectionEditLinks = true;
-
        /**
         * @var string|null The URL to send in a <link> element with rel=license
         */
@@ -1548,7 +1543,6 @@ class OutputPage extends ContextSource {
                        // Someone is trying to set a bogus pre-$wgUser PO. Check if it has
                        // been changed somehow, and keep it if so.
                        $anonPO = ParserOptions::newFromAnon();
-                       $anonPO->setEditSection( false );
                        $anonPO->setAllowUnsafeRawHtml( false );
                        if ( !$options->matches( $anonPO ) ) {
                                wfLogWarning( __METHOD__ . ': Setting a changed bogus ParserOptions: ' . wfGetAllCallers( 5 ) );
@@ -1562,7 +1556,6 @@ class OutputPage extends ContextSource {
                                // ParserOptions for it. And don't cache this ParserOptions
                                // either.
                                $po = ParserOptions::newFromAnon();
-                               $po->setEditSection( false );
                                $po->setAllowUnsafeRawHtml( false );
                                $po->isBogus = true;
                                if ( $options !== null ) {
@@ -1572,7 +1565,6 @@ class OutputPage extends ContextSource {
                        }
 
                        $this->mParserOptions = ParserOptions::newFromContext( $this->getContext() );
-                       $this->mParserOptions->setEditSection( false );
                        $this->mParserOptions->setAllowUnsafeRawHtml( false );
                }
 
@@ -1822,7 +1814,7 @@ class OutputPage extends ContextSource {
                // so that extensions may modify ParserOutput to toggle TOC.
                // This cannot be moved to addParserOutputText because that is not
                // called by EditPage for Preview.
-               if ( $parserOutput->getTOCEnabled() && $parserOutput->getTOCHTML() ) {
+               if ( $parserOutput->getTOCHTML() ) {
                        $this->mEnableTOC = true;
                }
        }
@@ -1868,17 +1860,6 @@ class OutputPage extends ContextSource {
         */
        function addParserOutput( $parserOutput, $poOptions = [] ) {
                $this->addParserOutputMetadata( $parserOutput );
-
-               // Touch section edit links only if not previously disabled
-               if ( $parserOutput->getEditSectionTokens() ) {
-                       $parserOutput->setEditSectionTokens( $this->mEnableSectionEditLinks );
-               }
-               if ( !$this->mEnableSectionEditLinks
-                       && !array_key_exists( 'enableSectionEditLinks', $poOptions )
-               ) {
-                       $poOptions['enableSectionEditLinks'] = false;
-               }
-
                $this->addParserOutputText( $parserOutput, $poOptions );
        }
 
@@ -3896,7 +3877,7 @@ class OutputPage extends ContextSource {
         * @deprecated since 1.31, use $poOptions to addParserOutput() instead.
         */
        public function enableSectionEditLinks( $flag = true ) {
-               $this->mEnableSectionEditLinks = $flag;
+               wfDeprecated( __METHOD__, '1.31' );
        }
 
        /**
@@ -3905,7 +3886,8 @@ class OutputPage extends ContextSource {
         * @deprecated since 1.31, use $poOptions to addParserOutput() instead.
         */
        public function sectionEditLinksEnabled() {
-               return $this->mEnableSectionEditLinks;
+               wfDeprecated( __METHOD__, '1.31' );
+               return true;
        }
 
        /**
index 3326fab..cbd62a9 100644 (file)
@@ -536,7 +536,6 @@ class ApiParse extends ApiBase {
                $popts->enableLimitReport( !$params['disablepp'] && !$params['disablelimitreport'] );
                $popts->setIsPreview( $params['preview'] || $params['sectionpreview'] );
                $popts->setIsSectionPreview( $params['sectionpreview'] );
-               $popts->setEditSection( !$params['disableeditsection'] );
                if ( $params['disabletidy'] ) {
                        $popts->setTidy( false );
                }
index 63c03af..d5ff6cb 100644 (file)
@@ -191,13 +191,11 @@ class MessageCache {
                                // ParserOptions for it. And don't cache this ParserOptions
                                // either.
                                $po = ParserOptions::newFromAnon();
-                               $po->setEditSection( false );
                                $po->setAllowUnsafeRawHtml( false );
                                return $po;
                        }
 
                        $this->mParserOptions = new ParserOptions;
-                       $this->mParserOptions->setEditSection( false );
                        // Messages may take parameters that could come
                        // from malicious sources. As a precaution, disable
                        // the <html> parser tag when parsing messages.
index e76bffc..fa30d68 100644 (file)
@@ -658,11 +658,6 @@ class DifferenceEngine extends ContextSource {
         */
        protected function getParserOutput( WikiPage $page, Revision $rev ) {
                $parserOptions = $page->makeParserOptions( $this->getContext() );
-
-               if ( !$rev->isCurrent() || !$rev->getTitle()->quickUserCan( 'edit', $this->getUser() ) ) {
-                       $parserOptions->setEditSection( false );
-               }
-
                $parserOutput = $page->getParserOutput( $parserOptions, $rev->getId() );
 
                return $parserOutput;
index dbd143c..f5e12d6 100644 (file)
@@ -445,7 +445,6 @@ abstract class Installer {
 
                $this->parserTitle = Title::newFromText( 'Installer' );
                $this->parserOptions = new ParserOptions( $wgUser ); // language will be wrong :(
-               $this->parserOptions->setEditSection( false );
                // Don't try to access DB before user language is initialised
                $this->setParserLanguage( Language::factory( 'en' ) );
        }
index 343c4c8..8eb3709 100644 (file)
@@ -480,12 +480,10 @@ class Article implements Page {
                # Render printable version, use printable version cache
                if ( $outputPage->isPrintable() ) {
                        $parserOptions->setIsPrintable( true );
-                       $parserOptions->setEditSection( false );
                        $poOptions['enableSectionEditLinks'] = false;
                } elseif ( $this->disableSectionEditForRender
                        || !$this->isCurrent() || !$this->getTitle()->quickUserCan( 'edit', $user )
                ) {
-                       $parserOptions->setEditSection( false );
                        $poOptions['enableSectionEditLinks'] = false;
                }
 
@@ -1526,7 +1524,6 @@ class Article implements Page {
        public function render() {
                $this->getContext()->getRequest()->response()->header( 'X-Robots-Tag: noindex' );
                $this->getContext()->getOutput()->setArticleBodyOnly( true );
-               $this->getContext()->getOutput()->enableSectionEditLinks( false );
                $this->disableSectionEditForRender = true;
                $this->view();
        }
index b2d8511..2adfd0a 100644 (file)
@@ -4032,13 +4032,9 @@ class Parser {
 
                # Inhibit editsection links if requested in the page
                if ( isset( $this->mDoubleUnderscores['noeditsection'] ) ) {
-                       $maybeShowEditLink = $showEditLink = false;
+                       $maybeShowEditLink = false;
                } else {
-                       $maybeShowEditLink = true; /* Actual presence will depend on ParserOptions option */
-                       $showEditLink = $this->mOptions->getEditSection();
-               }
-               if ( $showEditLink ) {
-                       $this->mOutput->setEditSectionTokens( true );
+                       $maybeShowEditLink = true; /* Actual presence will depend on post-cache transforms */
                }
 
                # Get all headlines for numbering them and adding funky stuff like [edit]
@@ -4390,9 +4386,9 @@ class Parser {
                         * $this : caller
                         * $section : the section number
                         * &$sectionContent : ref to the content of the section
-                        * $showEditLinks : boolean describing whether this section has an edit link
+                        * $maybeShowEditLinks : boolean describing whether this section has an edit link
                         */
-                       Hooks::run( 'ParserSectionCreate', [ $this, $i, &$sections[$i], $showEditLink ] );
+                       Hooks::run( 'ParserSectionCreate', [ $this, $i, &$sections[$i], $maybeShowEditLink ] );
 
                        $i++;
                }
index c680129..8a7fca6 100644 (file)
@@ -253,11 +253,6 @@ class ParserCache {
 
                wfDebug( "ParserOutput cache found.\n" );
 
-               // The edit section preference may not be the appropiate one in
-               // the ParserOutput, as we are not storing it in the parsercache
-               // key. Force it here. See T33445.
-               $value->setEditSectionTokens( $popts->getEditSection() );
-
                $wikiPage = method_exists( $article, 'getPage' )
                        ? $article->getPage()
                        : $article;
index ca8e739..bbddbe2 100644 (file)
@@ -80,13 +80,6 @@ class ParserOptions {
         */
        private $mTimestamp;
 
-       /**
-        * The edit section flag is in ParserOptions for historical reasons, but
-        * doesn't actually affect the parser output since Feb 2015.
-        * @var bool
-        */
-       private $mEditSection = true;
-
        /**
         * Stored user object
         * @var User
@@ -876,7 +869,8 @@ class ParserOptions {
         * @return bool
         */
        public function getEditSection() {
-               return $this->mEditSection;
+               wfDeprecated( __METHOD__, '1.31' );
+               return true;
        }
 
        /**
@@ -886,7 +880,8 @@ class ParserOptions {
         * @return bool Old value
         */
        public function setEditSection( $x ) {
-               return wfSetVar( $this->mEditSection, $x );
+               wfDeprecated( __METHOD__, '1.31' );
+               return true;
        }
 
        /**
@@ -1284,18 +1279,6 @@ class ParserOptions {
                $defaults = self::getCanonicalOverrides() + self::getDefaults();
                $inCacheKey = self::$inCacheKey;
 
-               // Historical hack: 'editsection' hasn't been a true parser option since
-               // Feb 2015 (instead the parser outputs a constant placeholder and post-parse
-               // processing handles the option). But Wikibase forces it in $forOptions
-               // and expects the cache key to still vary on it for T85252.
-               // @deprecated since 1.30, Wikibase should use addExtraKey() or something instead.
-               if ( in_array( 'editsection', $forOptions, true ) ) {
-                       $options['editsection'] = $this->mEditSection;
-                       $defaults['editsection'] = true;
-                       $inCacheKey['editsection'] = true;
-                       ksort( $inCacheKey );
-               }
-
                // We only include used options with non-canonical values in the key
                // so adding a new option doesn't invalidate the entire parser cache.
                // The drawback to this is that changing the default value of an option
index 19375e0..8f0a1d7 100644 (file)
@@ -151,12 +151,6 @@ class ParserOutput extends CacheTime {
         */
        public $mSections = [];
 
-       /**
-        * @deprecated since 1.31 Use getText() options.
-        * @var bool $mEditSectionTokens prefix/suffix markers if edit sections were output as tokens.
-        */
-       public $mEditSectionTokens = true;
-
        /**
         * @var array $mProperties Name/value pairs to be cached in the DB.
         */
@@ -172,12 +166,6 @@ class ParserOutput extends CacheTime {
         */
        public $mTimestamp;
 
-       /**
-        * @deprecated since 1.31 Use getText() options.
-        * @var bool $mTOCEnabled Whether TOC should be shown, can't override __NOTOC__.
-        */
-       public $mTOCEnabled = true;
-
        /**
         * @var bool $mEnableOOUI Whether OOUI should be enabled.
         */
@@ -280,22 +268,9 @@ class ParserOutput extends CacheTime {
         * @return string HTML
         */
        public function getText( $options = [] ) {
-               if ( !array_key_exists( 'allowTOC', $options ) && empty( $this->mTOCEnabled ) ) {
-                       wfDeprecated( 'ParserOutput stateful allowTOC', '1.31' );
-               }
-
-               //  Note that while $this->mEditSectionTokens formerly defaulted to false,
-               //  ParserOptions->getEditSection() defaults to true and Parser copies
-               //  that to us so true makes more sense as the stateless default.
-               if ( !array_key_exists( 'enableSectionEditLinks', $options ) && !$this->mEditSectionTokens ) {
-                       wfDeprecated( 'ParserOutput stateful enableSectionEditLinks', '1.31' );
-               }
-
                $options += [
-                       // empty() here because old cached versions might lack the field somehow.
-                       // In that situation, the historical behavior (possibly buggy) is to remove the TOC.
-                       'allowTOC' => !empty( $this->mTOCEnabled ),
-                       'enableSectionEditLinks' => $this->mEditSectionTokens,
+                       'allowTOC' => true,
+                       'enableSectionEditLinks' => true,
                        'unwrap' => false,
                        'deduplicateStyles' => true,
                ];
@@ -442,7 +417,8 @@ class ParserOutput extends CacheTime {
         * @deprecated since 1.31 Use getText() options.
         */
        public function getEditSectionTokens() {
-               return $this->mEditSectionTokens;
+               wfDeprecated( __METHOD__, '1.31' );
+               return true;
        }
 
        public function &getLinks() {
@@ -532,7 +508,8 @@ class ParserOutput extends CacheTime {
         * @deprecated since 1.31 Use getText() options.
         */
        public function getTOCEnabled() {
-               return $this->mTOCEnabled;
+               wfDeprecated( __METHOD__, '1.31' );
+               return true;
        }
 
        public function getEnableOOUI() {
@@ -563,7 +540,8 @@ class ParserOutput extends CacheTime {
         * @deprecated since 1.31 Use getText() options.
         */
        public function setEditSectionTokens( $t ) {
-               return wfSetVar( $this->mEditSectionTokens, $t );
+               wfDeprecated( __METHOD__, '1.31' );
+               return true;
        }
 
        public function setIndexPolicy( $policy ) {
@@ -582,7 +560,8 @@ class ParserOutput extends CacheTime {
         * @deprecated since 1.31 Use getText() options.
         */
        public function setTOCEnabled( $flag ) {
-               return wfSetVar( $this->mTOCEnabled, $flag );
+               wfDeprecated( __METHOD__, '1.31' );
+               return true;
        }
 
        public function addCategory( $c, $sort ) {
index f821eff..127a36b 100644 (file)
@@ -450,9 +450,7 @@ class SpecialUndelete extends SpecialPage {
                if ( ( $this->mPreview || !$isText ) && $content ) {
                        // NOTE: non-text content has no source view, so always use rendered preview
 
-                       // Hide [edit]s
                        $popts = $out->parserOptions();
-                       $popts->setEditSection( false );
 
                        $pout = $content->getParserOutput( $this->mTargetObj, $rev->getId(), $popts, true );
                        $out->addParserOutput( $pout, [
index d55372c..e2ed1d5 100644 (file)
@@ -141,23 +141,6 @@ class ParserOptionsTest extends MediaWikiTestCase {
                $confstr .= '!onPageRenderingHash';
        }
 
-       // Test weird historical behavior is still weird
-       public function testOptionsHashEditSection() {
-               $popt = ParserOptions::newCanonical();
-               $popt->registerWatcher( function ( $name ) {
-                       $this->assertNotEquals( 'editsection', $name );
-               } );
-
-               $this->assertTrue( $popt->getEditSection() );
-               $this->assertSame( 'canonical', $popt->optionsHash( [] ) );
-               $this->assertSame( 'canonical', $popt->optionsHash( [ 'editsection' ] ) );
-
-               $popt->setEditSection( false );
-               $this->assertFalse( $popt->getEditSection() );
-               $this->assertSame( 'canonical', $popt->optionsHash( [] ) );
-               $this->assertSame( 'editsection=0', $popt->optionsHash( [ 'editsection' ] ) );
-       }
-
        /**
         * @expectedException InvalidArgumentException
         * @expectedExceptionMessage Unknown parser option bogus
index 44c1773..b08ba6c 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 
-use Wikimedia\TestingAccessWrapper;
-
 /**
  * @group Database
  *        ^--- trigger DB shadowing because we are using Title magic
@@ -95,31 +93,17 @@ class ParserOutputTest extends MediaWikiTestCase {
         * @covers ParserOutput::getText
         * @dataProvider provideGetText
         * @param array $options Options to getText()
-        * @param array $poState ParserOptions state fields to set
         * @param string $text Parser text
         * @param string $expect Expected output
         */
-       public function testGetText( $options, $poState, $text, $expect ) {
+       public function testGetText( $options, $text, $expect ) {
                $this->setMwGlobals( [
                        'wgArticlePath' => '/wiki/$1',
                        'wgScriptPath' => '/w',
                        'wgScript' => '/w/index.php',
                ] );
-               $this->hideDeprecated( 'ParserOutput stateful allowTOC' );
-               $this->hideDeprecated( 'ParserOutput stateful enableSectionEditLinks' );
 
                $po = new ParserOutput( $text );
-
-               // Emulate Parser
-               $po->setEditSectionTokens( true );
-
-               if ( $poState ) {
-                       $wrap = TestingAccessWrapper::newFromObject( $po );
-                       foreach ( $poState as $key => $value ) {
-                               $wrap->$key = $value;
-                       }
-               }
-
                $actual = $po->getText( $options );
                $this->assertSame( $expect, $actual );
        }
@@ -169,89 +153,8 @@ EOF;
 EOF;
 
                return [
-                       'No stateless options, default state' => [
-                               [], [], $text, <<<EOF
-<div class="mw-parser-output"><p>Test document.
-</p>
-<div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div>
-<ul>
-<li class="toclevel-1 tocsection-1"><a href="#Section_1"><span class="tocnumber">1</span> <span class="toctext">Section 1</span></a></li>
-<li class="toclevel-1 tocsection-2"><a href="#Section_2"><span class="tocnumber">2</span> <span class="toctext">Section 2</span></a>
-<ul>
-<li class="toclevel-2 tocsection-3"><a href="#Section_2.1"><span class="tocnumber">2.1</span> <span class="toctext">Section 2.1</span></a></li>
-</ul>
-</li>
-<li class="toclevel-1 tocsection-4"><a href="#Section_3"><span class="tocnumber">3</span> <span class="toctext">Section 3</span></a></li>
-</ul>
-</div>
-
-<h2><span class="mw-headline" id="Section_1">Section 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Test_Page&amp;action=edit&amp;section=1" title="Edit section: Section 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-<p>One
-</p>
-<h2><span class="mw-headline" id="Section_2">Section 2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Test_Page&amp;action=edit&amp;section=2" title="Edit section: Section 2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-<p>Two
-</p>
-<h3><span class="mw-headline" id="Section_2.1">Section 2.1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Test_Page&amp;action=edit&amp;section=3" title="Edit section: Section 2.1">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
-<p>Two point one
-</p>
-<h2><span class="mw-headline" id="Section_3">Section 3</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Test_Page&amp;action=edit&amp;section=4" title="Edit section: Section 3">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-<p>Three
-</p></div>
-EOF
-                       ],
-                       'No stateless options, TOC statefully disabled' => [
-                               [], [ 'mTOCEnabled' => false ], $text, <<<EOF
-<div class="mw-parser-output"><p>Test document.
-</p>
-
-<h2><span class="mw-headline" id="Section_1">Section 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Test_Page&amp;action=edit&amp;section=1" title="Edit section: Section 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-<p>One
-</p>
-<h2><span class="mw-headline" id="Section_2">Section 2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Test_Page&amp;action=edit&amp;section=2" title="Edit section: Section 2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-<p>Two
-</p>
-<h3><span class="mw-headline" id="Section_2.1">Section 2.1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Test_Page&amp;action=edit&amp;section=3" title="Edit section: Section 2.1">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
-<p>Two point one
-</p>
-<h2><span class="mw-headline" id="Section_3">Section 3</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Test_Page&amp;action=edit&amp;section=4" title="Edit section: Section 3">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-<p>Three
-</p></div>
-EOF
-                       ],
-                       'No stateless options, section edits statefully disabled' => [
-                               [], [ 'mEditSectionTokens' => false ], $text, <<<EOF
-<div class="mw-parser-output"><p>Test document.
-</p>
-<div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div>
-<ul>
-<li class="toclevel-1 tocsection-1"><a href="#Section_1"><span class="tocnumber">1</span> <span class="toctext">Section 1</span></a></li>
-<li class="toclevel-1 tocsection-2"><a href="#Section_2"><span class="tocnumber">2</span> <span class="toctext">Section 2</span></a>
-<ul>
-<li class="toclevel-2 tocsection-3"><a href="#Section_2.1"><span class="tocnumber">2.1</span> <span class="toctext">Section 2.1</span></a></li>
-</ul>
-</li>
-<li class="toclevel-1 tocsection-4"><a href="#Section_3"><span class="tocnumber">3</span> <span class="toctext">Section 3</span></a></li>
-</ul>
-</div>
-
-<h2><span class="mw-headline" id="Section_1">Section 1</span></h2>
-<p>One
-</p>
-<h2><span class="mw-headline" id="Section_2">Section 2</span></h2>
-<p>Two
-</p>
-<h3><span class="mw-headline" id="Section_2.1">Section 2.1</span></h3>
-<p>Two point one
-</p>
-<h2><span class="mw-headline" id="Section_3">Section 3</span></h2>
-<p>Three
-</p></div>
-EOF
-                       ],
-                       'Stateless options override stateful settings' => [
-                               [ 'allowTOC' => true, 'enableSectionEditLinks' => true ],
-                               [ 'mTOCEnabled' => false, 'mEditSectionTokens' => false ],
-                               $text, <<<EOF
+                       'No options' => [
+                               [], $text, <<<EOF
 <div class="mw-parser-output"><p>Test document.
 </p>
 <div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div>
@@ -280,8 +183,8 @@ EOF
 </p></div>
 EOF
                        ],
-                       'Statelessly disable section edit links' => [
-                               [ 'enableSectionEditLinks' => false ], [], $text, <<<EOF
+                       'Disable section edit links' => [
+                               [ 'enableSectionEditLinks' => false ], $text, <<<EOF
 <div class="mw-parser-output"><p>Test document.
 </p>
 <div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div>
@@ -310,8 +213,8 @@ EOF
 </p></div>
 EOF
                        ],
-                       'Statelessly disable TOC' => [
-                               [ 'allowTOC' => false ], [], $text, <<<EOF
+                       'Disable TOC' => [
+                               [ 'allowTOC' => false ], $text, <<<EOF
 <div class="mw-parser-output"><p>Test document.
 </p>
 
@@ -329,8 +232,8 @@ EOF
 </p></div>
 EOF
                        ],
-                       'Statelessly unwrap text' => [
-                               [ 'unwrap' => true ], [], $text, <<<EOF
+                       'Unwrap text' => [
+                               [ 'unwrap' => true ], $text, <<<EOF
 <p>Test document.
 </p>
 <div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div>
@@ -360,15 +263,15 @@ EOF
 EOF
                        ],
                        'Unwrap without a mw-parser-output wrapper' => [
-                               [ 'unwrap' => true ], [], '<div class="foobar">Content</div>', '<div class="foobar">Content</div>'
+                               [ 'unwrap' => true ], '<div class="foobar">Content</div>', '<div class="foobar">Content</div>'
                        ],
                        'Unwrap with extra comment at end' => [
-                               [ 'unwrap' => true ], [], '<div class="mw-parser-output"><p>Test document.</p></div>
+                               [ 'unwrap' => true ], '<div class="mw-parser-output"><p>Test document.</p></div>
 <!-- Saved in parser cache... -->', '<p>Test document.</p>
 <!-- Saved in parser cache... -->'
                        ],
                        'Style deduplication' => [
-                               [], [], $dedupText, <<<EOF
+                               [], $dedupText, <<<EOF
 <p>This is a test document.</p>
 <style data-mw-deduplicate="duplicate1">.Duplicate1 {}</style>
 <link rel="mw-deduplicated-inline-style" href="mw-data:duplicate1"/>
@@ -382,7 +285,7 @@ EOF
 EOF
                        ],
                        'Style deduplication disabled' => [
-                               [ 'deduplicateStyles' => false ], [], $dedupText, $dedupText
+                               [ 'deduplicateStyles' => false ], $dedupText, $dedupText
                        ],
                ];
                // phpcs:enable