Hard-deprecate ContentHandler::getContentText()
No remaining uses in WMF-deployed extensions. (Although there is a similarly named but separate function in CiteThisPage.) Bug: T268041 Change-Id: Iec68845c631758fe85d32a939b28b6d8b1243858
This commit is contained in:
parent
e2fd40cb77
commit
f28348d9c0
3 changed files with 7 additions and 1 deletions
|
|
@ -123,6 +123,8 @@ because of Phabricator reports.
|
|||
* ISQLPlatform::tableNamesN() is now deprecated.
|
||||
* The implementation in SQLPlatform of ISQLPlatform::tableNames(), deprecated in
|
||||
MediaWiki 1.39, now emits deprecation warnings.
|
||||
* ContentHandler::getContentText(), deprecated in 1.37, now emits deprecation
|
||||
warnings.
|
||||
* …
|
||||
|
||||
=== Other changes in 1.43 ===
|
||||
|
|
|
|||
|
|
@ -89,12 +89,13 @@ abstract class ContentHandler {
|
|||
* @since 1.21
|
||||
*
|
||||
* @deprecated since 1.37, use Content::getText() for TextContent instances
|
||||
* instead
|
||||
* instead. Hard deprecated since 1.43.
|
||||
*
|
||||
* @param Content|null $content
|
||||
* @return string|null Textual form of the content, if available.
|
||||
*/
|
||||
public static function getContentText( Content $content = null ) {
|
||||
wfDeprecated( __METHOD__, '1.37' );
|
||||
if ( $content === null ) {
|
||||
return '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers \ContentHandler::getContentText
|
||||
*/
|
||||
public function testGetContentText_Null() {
|
||||
$this->hideDeprecated( 'ContentHandler::getContentText' );
|
||||
$content = null;
|
||||
$text = ContentHandler::getContentText( $content );
|
||||
$this->assertSame( '', $text );
|
||||
|
|
@ -174,6 +175,7 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers \ContentHandler::getContentText
|
||||
*/
|
||||
public function testGetContentText_TextContent() {
|
||||
$this->hideDeprecated( 'ContentHandler::getContentText' );
|
||||
$content = new WikitextContent( "hello world" );
|
||||
$text = ContentHandler::getContentText( $content );
|
||||
$this->assertEquals( $content->getText(), $text );
|
||||
|
|
@ -183,6 +185,7 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers \ContentHandler::getContentText
|
||||
*/
|
||||
public function testGetContentText_NonTextContent() {
|
||||
$this->hideDeprecated( 'ContentHandler::getContentText' );
|
||||
$content = new DummyContentForTesting( "hello world" );
|
||||
$text = ContentHandler::getContentText( $content );
|
||||
$this->assertNull( $text );
|
||||
|
|
|
|||
Loading…
Reference in a new issue