Refactor calls to deprecated function Content::getNativeData()
Function Content::getNativeData() was deprecated. Replace with calls to new function TextContent::getText() in most places. Bug: T155582 Change-Id: I2bd508c72aac4faf474ba45ab1f92e2e8d2eb9be
This commit is contained in:
parent
ff75ea4f05
commit
d993f499ee
22 changed files with 57 additions and 59 deletions
|
|
@ -173,7 +173,7 @@ class FeedUtils {
|
|||
|
||||
if ( $newContent instanceof TextContent ) {
|
||||
// only textual content has a "source view".
|
||||
$text = $newContent->getNativeData();
|
||||
$text = $newContent->getText();
|
||||
|
||||
if ( $wgFeedDiffCutoff <= 0 || strlen( $text ) > $wgFeedDiffCutoff ) {
|
||||
$html = null;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class LinkFilter {
|
|||
return 0;
|
||||
}
|
||||
|
||||
$text = $content->getNativeData();
|
||||
$text = $content->getText();
|
||||
|
||||
$regex = self::makeRegex( $filterEntry, $protocol );
|
||||
return preg_match( $regex, $text );
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class RawAction extends FormlessAction {
|
|||
// section not found (or section not supported, e.g. for JS, JSON, and CSS)
|
||||
$text = false;
|
||||
} else {
|
||||
$text = $content->getNativeData();
|
||||
$text = $content->getText();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ class ApiFeedContributions extends ApiBase {
|
|||
|
||||
if ( $content instanceof TextContent ) {
|
||||
// only textual content has a "source view".
|
||||
$html = nl2br( htmlspecialchars( $content->getNativeData() ) );
|
||||
$html = nl2br( htmlspecialchars( $content->getText() ) );
|
||||
} else {
|
||||
// XXX: we could get an HTML representation of the content via getParserOutput, but that may
|
||||
// contain JS magic and generally may not be suitable for inclusion in a feed.
|
||||
|
|
|
|||
|
|
@ -487,7 +487,7 @@ class ApiParse extends ApiBase {
|
|||
}
|
||||
|
||||
$wgParser->startExternalParse( $titleObj, $popts, Parser::OT_PREPROCESS );
|
||||
$xml = $wgParser->preprocessToDom( $this->content->getNativeData() )->__toString();
|
||||
$xml = $wgParser->preprocessToDom( $this->content->getText() )->__toString();
|
||||
$result_array['parsetree'] = $xml;
|
||||
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'parsetree';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -471,7 +471,7 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
|
|||
|
||||
if ( $this->fld_parsetree || ( $this->fld_content && $this->generateXML ) ) {
|
||||
if ( $content->getModel() === CONTENT_MODEL_WIKITEXT ) {
|
||||
$t = $content->getNativeData(); # note: don't set $text
|
||||
$t = $content->getText(); # note: don't set $text
|
||||
|
||||
$wgParser->startExternalParse(
|
||||
$title,
|
||||
|
|
@ -503,7 +503,7 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
|
|||
|
||||
if ( $this->expandTemplates && !$this->parseContent ) {
|
||||
if ( $content->getModel() === CONTENT_MODEL_WIKITEXT ) {
|
||||
$text = $content->getNativeData();
|
||||
$text = $content->getText();
|
||||
|
||||
$text = $wgParser->preprocess(
|
||||
$text,
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ abstract class ContentHandler {
|
|||
* If $content is null, this method returns the empty string.
|
||||
*
|
||||
* If $content is an instance of TextContent, this method returns the flat
|
||||
* text as returned by $content->getNativeData().
|
||||
* text as returned by $content->getText().
|
||||
*
|
||||
* If $content is not a TextContent object, the behavior of this method
|
||||
* depends on the global $wgContentHandlerTextFallback:
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ class SpecialBookSources extends SpecialPage {
|
|||
if ( $content instanceof TextContent ) {
|
||||
// XXX: in the future, this could be stored as structured data, defining a list of book sources
|
||||
|
||||
$text = $content->getNativeData();
|
||||
$text = $content->getText();
|
||||
$out->addWikiTextAsInterface( str_replace( 'MAGICNUMBER', $isbn, $text ) );
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -493,7 +493,7 @@ class SpecialUndelete extends SpecialPage {
|
|||
'readonly' => 'readonly',
|
||||
'cols' => 80,
|
||||
'rows' => 25
|
||||
], $content->getNativeData() . "\n" );
|
||||
], $content->getText() . "\n" );
|
||||
|
||||
$buttonFields[] = new OOUI\ButtonInputWidget( [
|
||||
'type' => 'submit',
|
||||
|
|
|
|||
|
|
@ -1033,7 +1033,7 @@ class LanguageConverter {
|
|||
$revision = Revision::newFromTitle( $title );
|
||||
if ( $revision ) {
|
||||
if ( $revision->getContentModel() == CONTENT_MODEL_WIKITEXT ) {
|
||||
$txt = $revision->getContent( Revision::RAW )->getNativeData();
|
||||
$txt = $revision->getContent( Revision::RAW )->getText();
|
||||
}
|
||||
|
||||
// @todo in the future, use a specialized content model, perhaps based on json!
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class CompareParsers extends DumpIterator {
|
|||
return;
|
||||
}
|
||||
|
||||
$text = strval( $content->getNativeData() );
|
||||
$text = strval( $content->getText() );
|
||||
|
||||
$output1 = $parser1->parse( $text, $title, $this->options );
|
||||
$output2 = $parser2->parse( $text, $title, $this->options );
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class PreprocessDump extends DumpIterator {
|
|||
}
|
||||
|
||||
try {
|
||||
$this->mPreprocessor->preprocessToObj( strval( $content->getNativeData() ), 0 );
|
||||
$this->mPreprocessor->preprocessToObj( strval( $content->getText() ), 0 );
|
||||
} catch ( Exception $e ) {
|
||||
$this->error( "Caught exception " . $e->getMessage() . " in "
|
||||
. $rev->getTitle()->getPrefixedText() );
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class ViewCLI extends Maintenance {
|
|||
$this->fatalError( "Non-text content models not supported" );
|
||||
}
|
||||
|
||||
$this->output( $content->getNativeData() );
|
||||
$this->output( $content->getText() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class SlotRecordTest extends MediaWikiTestCase {
|
|||
$this->assertTrue( $record->hasContentId() );
|
||||
$this->assertTrue( $record->hasRevision() );
|
||||
$this->assertTrue( $record->isInherited() );
|
||||
$this->assertSame( 'A', $record->getContent()->getNativeData() );
|
||||
$this->assertSame( 'A', $record->getContent()->getText() );
|
||||
$this->assertSame( 5, $record->getSize() );
|
||||
$this->assertSame( 'someHash', $record->getSha1() );
|
||||
$this->assertSame( CONTENT_MODEL_WIKITEXT, $record->getModel() );
|
||||
|
|
@ -75,7 +75,7 @@ class SlotRecordTest extends MediaWikiTestCase {
|
|||
$this->assertTrue( $record->hasRevision() );
|
||||
$this->assertFalse( $record->hasContentId() );
|
||||
$this->assertFalse( $record->isInherited() );
|
||||
$this->assertSame( 'A', $record->getContent()->getNativeData() );
|
||||
$this->assertSame( 'A', $record->getContent()->getText() );
|
||||
$this->assertSame( 1, $record->getSize() );
|
||||
$this->assertNotNull( $record->getSha1() );
|
||||
$this->assertSame( CONTENT_MODEL_WIKITEXT, $record->getModel() );
|
||||
|
|
@ -94,7 +94,7 @@ class SlotRecordTest extends MediaWikiTestCase {
|
|||
$this->assertFalse( $record->hasRevision() );
|
||||
$this->assertFalse( $record->isInherited() );
|
||||
$this->assertFalse( $record->hasOrigin() );
|
||||
$this->assertSame( 'A', $record->getContent()->getNativeData() );
|
||||
$this->assertSame( 'A', $record->getContent()->getText() );
|
||||
$this->assertSame( 1, $record->getSize() );
|
||||
$this->assertNotNull( $record->getSha1() );
|
||||
$this->assertSame( CONTENT_MODEL_WIKITEXT, $record->getModel() );
|
||||
|
|
@ -237,7 +237,7 @@ class SlotRecordTest extends MediaWikiTestCase {
|
|||
$this->assertTrue( $saved->hasContentId() );
|
||||
$this->assertSame( 'theNewAddress', $saved->getAddress() );
|
||||
$this->assertSame( 20, $saved->getContentId() );
|
||||
$this->assertSame( 'A', $saved->getContent()->getNativeData() );
|
||||
$this->assertSame( 'A', $saved->getContent()->getText() );
|
||||
$this->assertSame( 10, $saved->getRevision() );
|
||||
$this->assertSame( 10, $saved->getOrigin() );
|
||||
|
||||
|
|
|
|||
|
|
@ -657,7 +657,7 @@ abstract class RevisionDbTestBase extends MediaWikiTestCase {
|
|||
'new null revision should have the same SHA1 as the original revision' );
|
||||
$this->assertTrue( $orig->getRevisionRecord()->hasSameContent( $rev->getRevisionRecord() ),
|
||||
'new null revision should have the same content as the original revision' );
|
||||
$this->assertEquals( __METHOD__, $rev->getContent()->getNativeData() );
|
||||
$this->assertEquals( __METHOD__, $rev->getContent()->getText() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1379,7 +1379,7 @@ abstract class RevisionDbTestBase extends MediaWikiTestCase {
|
|||
);
|
||||
$rev = $this->testPage->getRevision();
|
||||
|
||||
$this->assertSame( $expectedText, $rev->getContent()->getNativeData() );
|
||||
$this->assertSame( $expectedText, $rev->getContent()->getText() );
|
||||
$this->assertSame( $expectedText, $rev->getSerializedData() );
|
||||
$this->assertSame( $this->testPage->getContentModel(), $rev->getContentModel() );
|
||||
$this->assertSame( $this->testPage->getContent()->getDefaultFormat(), $rev->getContentFormat() );
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
$content = $page->getContent();
|
||||
$this->assertNotNull( $content, 'Page should have been created' );
|
||||
|
||||
$text = $content->getNativeData();
|
||||
$text = $content->getText();
|
||||
|
||||
$this->assertSame( $expected, $text );
|
||||
}
|
||||
|
|
@ -176,7 +176,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
$this->assertSame( 'Success', $re['edit']['result'] );
|
||||
$newtext = WikiPage::factory( Title::newFromText( $name ) )
|
||||
->getContent( Revision::RAW )
|
||||
->getNativeData();
|
||||
->getText();
|
||||
$this->assertSame( "==section 1==\nnew content 1\n\n==section 2==\ncontent2", $newtext );
|
||||
|
||||
// Test that we raise a 'nosuchsection' error
|
||||
|
|
@ -216,7 +216,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
// Check the page text is correct
|
||||
$text = WikiPage::factory( Title::newFromText( $name ) )
|
||||
->getContent( Revision::RAW )
|
||||
->getNativeData();
|
||||
->getText();
|
||||
$this->assertSame( "== header ==\n\ntest", $text );
|
||||
|
||||
// Now on one that does
|
||||
|
|
@ -232,7 +232,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
$this->assertSame( 'Success', $re2['edit']['result'] );
|
||||
$text = WikiPage::factory( Title::newFromText( $name ) )
|
||||
->getContent( Revision::RAW )
|
||||
->getNativeData();
|
||||
->getText();
|
||||
$this->assertSame( "== header ==\n\ntest\n\n== header ==\n\ntest", $text );
|
||||
}
|
||||
|
||||
|
|
@ -733,7 +733,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
'undoafter' => $revId1,
|
||||
] );
|
||||
|
||||
$text = ( new WikiPage( $titleObj ) )->getContent()->getNativeData();
|
||||
$text = ( new WikiPage( $titleObj ) )->getContent()->getText();
|
||||
|
||||
// This is wrong! It should be 1. But let's test for our incorrect
|
||||
// behavior for now, so if someone fixes it they'll fix the test as
|
||||
|
|
@ -761,7 +761,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
] );
|
||||
|
||||
$text = ( new WikiPage( Title::newFromText( $name ) ) )->getContent()
|
||||
->getNativeData();
|
||||
->getText();
|
||||
$this->assertSame( '3', $text );
|
||||
}
|
||||
|
||||
|
|
@ -784,7 +784,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
] );
|
||||
|
||||
$text = ( new WikiPage( Title::newFromText( $name ) ) )->getContent()
|
||||
->getNativeData();
|
||||
->getText();
|
||||
$this->assertSame( '1', $text );
|
||||
}
|
||||
|
||||
|
|
@ -855,7 +855,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
] );
|
||||
|
||||
$text = ( new WikiPage( Title::newFromText( $name ) ) )
|
||||
->getContent()->getNativeData();
|
||||
->getContent()->getText();
|
||||
$this->assertSame( 'Alert: Some text', $text );
|
||||
}
|
||||
|
||||
|
|
@ -872,7 +872,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
] );
|
||||
|
||||
$text = ( new WikiPage( Title::newFromText( $name ) ) )
|
||||
->getContent()->getNativeData();
|
||||
->getContent()->getText();
|
||||
$this->assertSame( 'Some text is nice', $text );
|
||||
}
|
||||
|
||||
|
|
@ -890,7 +890,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
] );
|
||||
|
||||
$text = ( new WikiPage( Title::newFromText( $name ) ) )
|
||||
->getContent()->getNativeData();
|
||||
->getContent()->getText();
|
||||
$this->assertSame( 'Alert: Some text is nice', $text );
|
||||
}
|
||||
|
||||
|
|
@ -957,7 +957,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
} finally {
|
||||
// Validate that content was not changed
|
||||
$text = ( new WikiPage( Title::newFromText( $name ) ) )
|
||||
->getContent()->getNativeData();
|
||||
->getContent()->getText();
|
||||
|
||||
$this->assertSame( 'Some text', $text );
|
||||
}
|
||||
|
|
@ -1059,7 +1059,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
] );
|
||||
|
||||
$text = ( new WikiPage( Title::newFromText( $name ) ) )
|
||||
->getContent()->getNativeData();
|
||||
->getContent()->getText();
|
||||
|
||||
$this->assertSame( "Initial content\n\n== New section ==", $text );
|
||||
}
|
||||
|
|
@ -1097,7 +1097,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
$page = new WikiPage( Title::newFromText( $name ) );
|
||||
|
||||
$this->assertSame( "Initial content\n\n== My section ==\n\nMore content",
|
||||
$page->getContent()->getNativeData() );
|
||||
$page->getContent()->getText() );
|
||||
$this->assertSame( '/* My section */ new section',
|
||||
$page->getRevision()->getComment() );
|
||||
}
|
||||
|
|
@ -1118,7 +1118,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
$page = new WikiPage( Title::newFromText( $name ) );
|
||||
|
||||
$this->assertSame( "Initial content\n\n== Add new section ==\n\nMore content",
|
||||
$page->getContent()->getNativeData() );
|
||||
$page->getContent()->getText() );
|
||||
// EditPage actually assumes the summary is the section name here
|
||||
$this->assertSame( '/* Add new section */ new section',
|
||||
$page->getRevision()->getComment() );
|
||||
|
|
@ -1141,7 +1141,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
$page = new WikiPage( Title::newFromText( $name ) );
|
||||
|
||||
$this->assertSame( "Initial content\n\n== My section ==\n\nMore content",
|
||||
$page->getContent()->getNativeData() );
|
||||
$page->getContent()->getText() );
|
||||
$this->assertSame( 'Add new section',
|
||||
$page->getRevision()->getComment() );
|
||||
}
|
||||
|
|
@ -1160,7 +1160,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
] );
|
||||
|
||||
$text = ( new WikiPage( Title::newFromText( $name ) ) )
|
||||
->getContent()->getNativeData();
|
||||
->getContent()->getText();
|
||||
|
||||
$this->assertSame( "== Section 1 ==\n\nContent and more content\n\n" .
|
||||
"== Section 2 ==\n\nFascinating!", $text );
|
||||
|
|
@ -1179,7 +1179,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
] );
|
||||
|
||||
$text = ( new WikiPage( Title::newFromText( $name ) ) )
|
||||
->getContent()->getNativeData();
|
||||
->getContent()->getText();
|
||||
|
||||
$this->assertSame( "Content and more content\n\n== Section 1 ==\n\n" .
|
||||
"Fascinating!", $text );
|
||||
|
|
@ -1201,7 +1201,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
] );
|
||||
} finally {
|
||||
$text = ( new WikiPage( Title::newFromText( $name ) ) )
|
||||
->getContent()->getNativeData();
|
||||
->getContent()->getText();
|
||||
|
||||
$this->assertSame( 'Content', $text );
|
||||
}
|
||||
|
|
@ -1223,7 +1223,7 @@ class ApiEditPageTest extends ApiTestCase {
|
|||
] );
|
||||
} finally {
|
||||
$text = ( new WikiPage( Title::newFromText( $name ) ) )
|
||||
->getContent()->getNativeData();
|
||||
->getContent()->getText();
|
||||
|
||||
$this->assertSame( 'Content', $text );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ class CustomDifferenceEngine extends DifferenceEngine {
|
|||
}
|
||||
|
||||
public function generateContentDiffBody( Content $old, Content $new ) {
|
||||
return $old->getNativeData() . '|' . $new->getNativeData();
|
||||
return $old->getText() . '|' . $new->getText();
|
||||
}
|
||||
|
||||
public function showDiffStyle() {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class ImportTest extends MediaWikiLangTestCase {
|
|||
$title = Title::newFromText( $title );
|
||||
$this->assertTrue( $title->exists() );
|
||||
|
||||
$this->assertEquals( WikiPage::factory( $title )->getContent()->getNativeData(), $text );
|
||||
$this->assertEquals( WikiPage::factory( $title )->getContent()->getText(), $text );
|
||||
}
|
||||
|
||||
public function getUnknownTagsXML() {
|
||||
|
|
|
|||
|
|
@ -190,8 +190,7 @@ class ArticleViewTest extends MediaWikiTestCase {
|
|||
->willReturn( new ParserOutput( 'Structured Output' ) );
|
||||
$content->method( 'getModel' )
|
||||
->willReturn( 'NotText' );
|
||||
$content->method( 'getNativeData' )
|
||||
->willReturn( [ (object)[ 'x' => 'stuff' ] ] );
|
||||
$content->expects( $this->never() )->method( 'getNativeData' );
|
||||
$content->method( 'copy' )
|
||||
->willReturn( $content );
|
||||
|
||||
|
|
@ -447,7 +446,7 @@ class ArticleViewTest extends MediaWikiTestCase {
|
|||
'ArticleContentViewCustom',
|
||||
function ( Content $content, Title $title, OutputPage $output ) use ( $page ) {
|
||||
$this->assertSame( $page->getTitle(), $title, '$title' );
|
||||
$this->assertSame( 'Test A', $content->getNativeData(), '$content' );
|
||||
$this->assertSame( 'Test A', $content->getText(), '$content' );
|
||||
|
||||
$output->addHTML( 'Hook Text' );
|
||||
return false;
|
||||
|
|
@ -483,9 +482,8 @@ class ArticleViewTest extends MediaWikiTestCase {
|
|||
'ArticleRevisionViewCustom',
|
||||
function ( RevisionRecord $rev, Title $title, $oldid, OutputPage $output ) use ( $page ) {
|
||||
$content = $rev->getContent( SlotRecord::MAIN );
|
||||
|
||||
$this->assertSame( $page->getTitle(), $title, '$title' );
|
||||
$this->assertSame( 'Test A', $content->getNativeData(), '$content' );
|
||||
$this->assertSame( 'Test A', $content->getText(), '$content' );
|
||||
|
||||
$output->addHTML( 'Hook Text' );
|
||||
return false;
|
||||
|
|
@ -517,7 +515,7 @@ class ArticleViewTest extends MediaWikiTestCase {
|
|||
'ArticleAfterFetchContentObject',
|
||||
function ( Article &$articlePage, Content &$content ) use ( $page, $article ) {
|
||||
$this->assertSame( $article, $articlePage, '$articlePage' );
|
||||
$this->assertSame( 'Test A', $content->getNativeData(), '$content' );
|
||||
$this->assertSame( 'Test A', $content->getText(), '$content' );
|
||||
|
||||
$content = new WikitextContent( 'Hook Text' );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -737,7 +737,7 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase {
|
|||
$rev = $page->getRevision();
|
||||
|
||||
$this->assertEquals( $page->getLatest(), $rev->getId() );
|
||||
$this->assertEquals( "some text", $rev->getContent()->getNativeData() );
|
||||
$this->assertEquals( "some text", $rev->getContent()->getText() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -753,7 +753,7 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase {
|
|||
$this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT );
|
||||
|
||||
$content = $page->getContent();
|
||||
$this->assertEquals( "some text", $content->getNativeData() );
|
||||
$this->assertEquals( "some text", $content->getText() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1111,7 +1111,7 @@ more stuff
|
|||
$content = ContentHandler::makeContent( $with, $page->getTitle(), $page->getContentModel() );
|
||||
$c = $page->replaceSectionContent( $section, $content, $sectionTitle );
|
||||
|
||||
$this->assertEquals( $expected, is_null( $c ) ? null : trim( $c->getNativeData() ) );
|
||||
$this->assertEquals( $expected, is_null( $c ) ? null : trim( $c->getText() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1127,7 +1127,7 @@ more stuff
|
|||
$content = ContentHandler::makeContent( $with, $page->getTitle(), $page->getContentModel() );
|
||||
$c = $page->replaceSectionAtRev( $section, $content, $sectionTitle, $baseRevId );
|
||||
|
||||
$this->assertEquals( $expected, is_null( $c ) ? null : trim( $c->getNativeData() ) );
|
||||
$this->assertEquals( $expected, is_null( $c ) ? null : trim( $c->getText() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1242,7 +1242,7 @@ more stuff
|
|||
$page = new WikiPage( $page->getTitle() );
|
||||
$this->assertEquals( $rev2->getSha1(), $page->getRevision()->getSha1(),
|
||||
"rollback did not revert to the correct revision" );
|
||||
$this->assertEquals( "one\n\ntwo", $page->getContent()->getNativeData() );
|
||||
$this->assertEquals( "one\n\ntwo", $page->getContent()->getText() );
|
||||
|
||||
$rc = MediaWikiServices::getInstance()->getRevisionStore()->getRecentChange(
|
||||
$page->getRevision()->getRevisionRecord()
|
||||
|
|
@ -1332,7 +1332,7 @@ more stuff
|
|||
$page = new WikiPage( $page->getTitle() );
|
||||
$this->assertEquals( $rev1->getSha1(), $page->getRevision()->getSha1(),
|
||||
"rollback did not revert to the correct revision" );
|
||||
$this->assertEquals( "one", $page->getContent()->getNativeData() );
|
||||
$this->assertEquals( "one", $page->getContent()->getText() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1817,8 +1817,8 @@ more stuff
|
|||
$fetchedPage = WikiPage::newFromID( $createdPage->getId() );
|
||||
$this->assertSame( $createdPage->getId(), $fetchedPage->getId() );
|
||||
$this->assertEquals(
|
||||
$createdPage->getContent()->getNativeData(),
|
||||
$fetchedPage->getContent()->getNativeData()
|
||||
$createdPage->getContent()->getText(),
|
||||
$fetchedPage->getContent()->getText()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class DummyContentForTesting extends AbstractContent {
|
|||
public function getParserOutput( Title $title, $revId = null,
|
||||
ParserOptions $options = null, $generateHtml = true
|
||||
) {
|
||||
return new ParserOutput( $this->getNativeData() );
|
||||
return new ParserOutput( $this->data );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -118,6 +118,6 @@ class DummyContentForTesting extends AbstractContent {
|
|||
*/
|
||||
protected function fillParserOutput( Title $title, $revId,
|
||||
ParserOptions $options, $generateHtml, ParserOutput &$output ) {
|
||||
$output = new ParserOutput( $this->getNativeData() );
|
||||
$output = new ParserOutput( $this->data );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class DummyNonTextContent extends AbstractContent {
|
|||
public function getParserOutput( Title $title, $revId = null,
|
||||
ParserOptions $options = null, $generateHtml = true
|
||||
) {
|
||||
return new ParserOutput( $this->getNativeData() );
|
||||
return new ParserOutput( $this->serialize() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -116,6 +116,6 @@ class DummyNonTextContent extends AbstractContent {
|
|||
*/
|
||||
protected function fillParserOutput( Title $title, $revId,
|
||||
ParserOptions $options, $generateHtml, ParserOutput &$output ) {
|
||||
$output = new ParserOutput( $this->getNativeData() );
|
||||
$output = new ParserOutput( $this->serialize() );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue