From 4d596861e50fecd3fee8d545faf1610eb81487ef Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Fri, 26 Oct 2018 11:28:12 -0400 Subject: [PATCH] Hard deprecate OutputPage::parse() and OutputPage::parseInline() Depends-On: I2cc3a4631bcb45b7f8cd913e9b6dba14349e5e9e Depends-On: Ieaac7a198cacec406a8240ed07b2d9f32ef9e56a Depends-On: Ia4b63715380d97ccb3133bf39a260834c20b4f5a Depends-On: I88fb74c3007360e2301c8bca7db6a940e966a735 Change-Id: If5c619cdd3e7f786687cfc2ca166074d9197ca11 --- includes/OutputPage.php | 2 ++ tests/phpunit/includes/OutputPageTest.php | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index aa2afe962d..ff044f4fd1 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2098,6 +2098,7 @@ class OutputPage extends ContextSource { * parseAsInterface() if $interface is true. */ public function parse( $text, $linestart = true, $interface = false, $language = null ) { + wfDeprecated( __METHOD__, '1.33' ); return $this->parseInternal( $text, $this->getTitle(), $linestart, /*tidy*/false, $interface, $language )->getText( [ @@ -2180,6 +2181,7 @@ class OutputPage extends ContextSource { * Parser::stripOuterParagraph($outputPage->parseAsContent(...)). */ public function parseInline( $text, $linestart = true, $interface = false ) { + wfDeprecated( __METHOD__, '1.33' ); $parsed = $this->parseInternal( $text, $this->getTitle(), $linestart, /*tidy*/false, $interface, /*language*/null )->getText( [ diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index e572be215d..00a08a719d 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -1806,6 +1806,7 @@ class OutputPageTest extends MediaWikiTestCase { * @param string $expectedHTML Expected return value for parseInline(), if different */ public function testParse( array $args, $expectedHTML ) { + $this->hideDeprecated( 'OutputPage::parse' ); $op = $this->newInstance(); $this->assertSame( $expectedHTML, $op->parse( ...$args ) ); } @@ -1820,6 +1821,7 @@ class OutputPageTest extends MediaWikiTestCase { $this->assertTrue( true ); return; } + $this->hideDeprecated( 'OutputPage::parseInline' ); $op = $this->newInstance(); $this->assertSame( $expectedHTMLInline ?? $expectedHTML, $op->parseInline( ...$args ) ); } @@ -1953,6 +1955,7 @@ class OutputPageTest extends MediaWikiTestCase { * @covers OutputPage::parse */ public function testParseNullTitle() { + $this->hideDeprecated( 'OutputPage::parse' ); $this->setExpectedException( MWException::class, 'Empty $mTitle in OutputPage::parseInternal' ); $op = $this->newInstance( [], null, 'notitle' ); $op->parse( '' ); @@ -1962,6 +1965,7 @@ class OutputPageTest extends MediaWikiTestCase { * @covers OutputPage::parseInline */ public function testParseInlineNullTitle() { + $this->hideDeprecated( 'OutputPage::parseInline' ); $this->setExpectedException( MWException::class, 'Empty $mTitle in OutputPage::parseInternal' ); $op = $this->newInstance( [], null, 'notitle' ); $op->parseInline( '' ); -- 2.20.1