Hard deprecate OutputPage::parse() and OutputPage::parseInline()

Depends-On: I2cc3a4631bcb45b7f8cd913e9b6dba14349e5e9e
Depends-On: Ieaac7a198cacec406a8240ed07b2d9f32ef9e56a
Depends-On: Ia4b63715380d97ccb3133bf39a260834c20b4f5a
Depends-On: I88fb74c3007360e2301c8bca7db6a940e966a735
Change-Id: If5c619cdd3e7f786687cfc2ca166074d9197ca11
This commit is contained in:
C. Scott Ananian 2018-10-26 11:28:12 -04:00 committed by C. Scott Ananian
parent 24cb939294
commit 4d596861e5
2 changed files with 6 additions and 0 deletions

View file

@ -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( [

View file

@ -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( '' );