19use PHPUnit\Framework\MockObject\MockObject;
24use Wikimedia\TestingAccessWrapper;
36 MWTimestamp::setFakeTime(
false );
56 $title = ( $title instanceof
Title ) ? $title : $this->
getTitle( $title );
58 return WikiPage::factory( $title );
67 if ( is_string( $page ) || $page instanceof
Title ) {
68 $page = $this->
getPage( $page );
71 $page = TestingAccessWrapper::newFromObject( $page );
72 return $page->getDerivedDataUpdater(
null, $rec );
86 $comment = CommentStoreComment::newUnsavedComment( $summary );
98 $updater = $page->newPageUpdater( $user );
100 foreach (
$content as $role => $c ) {
118 $page = $this->
getPage( __METHOD__ );
125 $update->modifyContent( SlotRecord::MAIN, $mainContent );
127 $updater->prepareContent( $user, $update,
false );
129 $options1 =
$updater->getCanonicalParserOptions();
131 $options1->getUserLangObj() );
133 $speculativeId = $options1->getSpeculativeRevId();
134 $this->assertSame( $parentRev->getId() + 1, $speculativeId );
140 $parentRev->getId() + 7,
145 $options2 =
$updater->getCanonicalParserOptions();
147 $currentRev = call_user_func( $options2->getCurrentRevisionCallback(), $page->getTitle() );
148 $this->assertSame(
$rev->getId(), $currentRev->getId() );
156 $page = $this->
getPage( __METHOD__ );
159 $this->assertNull( $updater0->grabCurrentRevision() );
160 $this->assertFalse( $updater0->pageExisted() );
164 $this->assertSame( $rev1->getId(), $updater1->grabCurrentRevision()->getId() );
165 $this->assertFalse( $updater0->pageExisted() );
166 $this->assertTrue( $updater1->pageExisted() );
170 $this->assertSame( $rev1->getId(), $updater1->grabCurrentRevision()->getId() );
171 $this->assertSame( $rev2->getId(), $updater2->grabCurrentRevision()->getId() );
189 $sysop = $this->
getTestUser( [
'sysop' ] )->getUser();
192 $this->assertFalse(
$updater->isContentPrepared() );
198 $auxSlot = SlotRecord::newSaved(
200 SlotRecord::newUnsaved(
'aux', $auxContent )
204 $update->modifyContent( SlotRecord::MAIN, $mainContent );
205 $update->modifySlot( SlotRecord::newInherited( $auxSlot ) );
208 $updater->prepareContent( $sysop, $update,
false );
211 $updater->prepareContent( $sysop, $update,
false );
213 $this->assertNull(
$updater->grabCurrentRevision() );
214 $this->assertTrue(
$updater->isContentPrepared() );
215 $this->assertFalse(
$updater->isUpdatePrepared() );
216 $this->assertFalse(
$updater->pageExisted() );
217 $this->assertTrue(
$updater->isCreation() );
218 $this->assertTrue(
$updater->isChange() );
219 $this->assertFalse(
$updater->isContentDeleted() );
221 $this->assertNotNull(
$updater->getRevision() );
222 $this->assertNotNull(
$updater->getRenderedRevision() );
224 $this->assertEquals( [
'main',
'aux' ],
$updater->getSlots()->getSlotRoles() );
225 $this->assertEquals( [
'main' ], array_keys(
$updater->getSlots()->getOriginalSlots() ) );
226 $this->assertEquals( [
'aux' ], array_keys(
$updater->getSlots()->getInheritedSlots() ) );
227 $this->assertEquals( [
'main',
'aux' ],
$updater->getModifiedSlotRoles() );
228 $this->assertEquals( [
'main',
'aux' ],
$updater->getTouchedSlotRoles() );
230 $mainSlot =
$updater->getRawSlot( SlotRecord::MAIN );
231 $this->assertInstanceOf( SlotRecord::class, $mainSlot );
232 $this->assertNotContains(
'~~~', $mainSlot->getContent()->serialize(),
'PST should apply.' );
233 $this->assertContains( $sysop->getName(), $mainSlot->getContent()->serialize() );
235 $auxSlot =
$updater->getRawSlot(
'aux' );
236 $this->assertInstanceOf( SlotRecord::class, $auxSlot );
237 $this->assertContains(
'~~~', $auxSlot->getContent()->serialize(),
'No PST should apply.' );
239 $mainOutput =
$updater->getCanonicalParserOutput();
240 $this->assertContains(
'first', $mainOutput->getText() );
241 $this->assertContains(
'<a ', $mainOutput->getText() );
242 $this->assertNotEmpty( $mainOutput->getLinks() );
244 $canonicalOutput =
$updater->getCanonicalParserOutput();
245 $this->assertContains(
'first', $canonicalOutput->getText() );
246 $this->assertContains(
'<a ', $canonicalOutput->getText() );
247 $this->assertContains(
'inherited ', $canonicalOutput->getText() );
248 $this->assertNotEmpty( $canonicalOutput->getLinks() );
258 $sysop = $this->
getTestUser( [
'sysop' ] )->getUser();
259 $page = $this->
getPage( __METHOD__ );
261 $mainContent1 =
new WikitextContent(
'first [[main]] ({{REVISIONUSER}}) #~~~#' );
262 $mainContent2 =
new WikitextContent(
'second ({{subst:REVISIONUSER}}) #~~~#' );
265 $mainContent1 =
$rev->getContent( SlotRecord::MAIN );
266 $userName =
$rev->getUser()->getName();
267 $sysopName = $sysop->getName();
270 $update->modifyContent( SlotRecord::MAIN, $mainContent1 );
272 $updater1->prepareContent( $sysop, $update,
false );
274 $this->assertNotNull( $updater1->grabCurrentRevision() );
275 $this->assertTrue( $updater1->isContentPrepared() );
276 $this->assertTrue( $updater1->pageExisted() );
277 $this->assertFalse( $updater1->isCreation() );
278 $this->assertFalse( $updater1->isChange() );
280 $this->assertNotNull( $updater1->getRevision() );
281 $this->assertNotNull( $updater1->getRenderedRevision() );
284 $html = $updater1->getRenderedRevision()->getRevisionParserOutput()->getText();
285 $this->assertNotContains( $sysopName,
$html,
'{{REVISIONUSER}}' );
286 $this->assertNotContains(
'{{REVISIONUSER}}',
$html,
'{{REVISIONUSER}}' );
287 $this->assertNotContains(
'~~~',
$html,
'signature ~~~' );
288 $this->assertContains(
'(' . $userName .
')',
$html,
'{{REVISIONUSER}}' );
289 $this->assertContains(
'>' . $userName .
'<',
$html,
'signature ~~~' );
293 $update->modifyContent( SlotRecord::MAIN, $mainContent2 );
295 $updater2->prepareContent( $sysop, $update,
false );
298 $pstText = $updater2->getSlots()->getContent( SlotRecord::MAIN )->serialize();
299 $this->assertNotContains(
'{{subst:REVISIONUSER}}', $pstText,
'{{subst:REVISIONUSER}}' );
300 $this->assertNotContains(
'~~~', $pstText,
'signature ~~~' );
301 $this->assertContains(
'(' . $sysopName .
')', $pstText,
'{{subst:REVISIONUSER}}' );
302 $this->assertContains(
':' . $sysopName .
'|', $pstText,
'signature ~~~' );
304 $this->assertFalse( $updater2->isCreation() );
305 $this->assertTrue( $updater2->isChange() );
326 $page = $this->
getPage( __METHOD__ );
333 $updater1->prepareUpdate( $rev1,
$options );
335 $this->assertTrue( $updater1->isUpdatePrepared() );
336 $this->assertTrue( $updater1->isContentPrepared() );
337 $this->assertTrue( $updater1->isCreation() );
338 $this->assertTrue( $updater1->isChange() );
339 $this->assertFalse( $updater1->isContentDeleted() );
341 $this->assertNotNull( $updater1->getRevision() );
342 $this->assertNotNull( $updater1->getRenderedRevision() );
344 $this->assertEquals( [
'main' ], $updater1->getSlots()->getSlotRoles() );
345 $this->assertEquals( [
'main' ], array_keys( $updater1->getSlots()->getOriginalSlots() ) );
346 $this->assertEquals( [], array_keys( $updater1->getSlots()->getInheritedSlots() ) );
347 $this->assertEquals( [
'main' ], $updater1->getModifiedSlotRoles() );
348 $this->assertEquals( [
'main' ], $updater1->getTouchedSlotRoles() );
352 $this->assertInstanceOf( SlotRecord::class, $updater1->getRawSlot( SlotRecord::MAIN ) );
353 $this->assertNotContains(
'~~~~', $updater1->getRawContent( SlotRecord::MAIN )->serialize() );
355 $mainOutput = $updater1->getCanonicalParserOutput();
356 $this->assertContains(
'first', $mainOutput->getText() );
357 $this->assertContains(
'<a ', $mainOutput->getText() );
358 $this->assertNotEmpty( $mainOutput->getLinks() );
360 $canonicalOutput = $updater1->getCanonicalParserOutput();
361 $this->assertContains(
'first', $canonicalOutput->getText() );
362 $this->assertContains(
'<a ', $canonicalOutput->getText() );
363 $this->assertNotEmpty( $canonicalOutput->getLinks() );
370 $updater2->prepareUpdate( $rev2,
$options );
372 $this->assertFalse( $updater2->isCreation() );
373 $this->assertTrue( $updater2->isChange() );
375 $canonicalOutput = $updater2->getCanonicalParserOutput();
376 $this->assertContains(
'second', $canonicalOutput->getText() );
384 $page = $this->
getPage( __METHOD__ );
389 $update->modifyContent( SlotRecord::MAIN, $mainContent1 );
391 $updater->prepareContent( $user, $update,
false );
393 $mainOutput =
$updater->getSlotParserOutput( SlotRecord::MAIN );
394 $canonicalOutput =
$updater->getCanonicalParserOutput();
401 $this->assertTrue(
$updater->isUpdatePrepared() );
402 $this->assertTrue(
$updater->isContentPrepared() );
404 $this->assertSame( $mainOutput,
$updater->getSlotParserOutput( SlotRecord::MAIN ) );
405 $this->assertSame( $canonicalOutput,
$updater->getCanonicalParserOutput() );
414 $page = $this->
getPage( __METHOD__ );
419 $update->modifyContent( SlotRecord::MAIN, $mainContent1 );
421 $updater->prepareContent( $user, $update,
false );
423 $mainOutput =
$updater->getSlotParserOutput( SlotRecord::MAIN );
424 $canonicalOutput =
$updater->getCanonicalParserOutput();
427 $mainOutput->setSpeculativeRevIdUsed( 0 );
428 $canonicalOutput->setSpeculativeRevIdUsed( 0 );
435 $this->assertTrue(
$updater->isUpdatePrepared() );
436 $this->assertTrue(
$updater->isContentPrepared() );
439 $this->assertNotSame( $mainOutput,
$updater->getSlotParserOutput( SlotRecord::MAIN ) );
440 $this->assertNotSame( $canonicalOutput,
$updater->getCanonicalParserOutput() );
443 $this->assertContains(
'--' .
$rev->getId() .
'--',
$html );
460 $update->modifyContent( SlotRecord::MAIN, $mainContent );
463 $updater->prepareContent( $user, $update,
false );
465 $canonicalOutput =
$updater->getCanonicalParserOutput();
467 $preparedEdit =
$updater->getPreparedEdit();
468 $this->assertSame( $canonicalOutput->getCacheTime(), $preparedEdit->timestamp );
469 $this->assertSame( $canonicalOutput, $preparedEdit->output );
470 $this->assertSame( $mainContent, $preparedEdit->newContent );
471 $this->assertSame(
$updater->getRawContent( SlotRecord::MAIN ), $preparedEdit->pstContent );
472 $this->assertSame(
$updater->getCanonicalParserOptions(), $preparedEdit->popts );
473 $this->assertSame(
null, $preparedEdit->revid );
480 $clock = MWTimestamp::convert( TS_UNIX,
'20100101000000' );
481 MWTimestamp::setFakeTime(
function () use ( &$clock ) {
485 $page = $this->
getPage( __METHOD__ );
489 $update->setContent( SlotRecord::MAIN, $mainContent );
496 $canonicalOutput =
$updater->getCanonicalParserOutput();
498 $preparedEdit =
$updater->getPreparedEdit();
499 $this->assertSame( $canonicalOutput->getCacheTime(), $preparedEdit->timestamp );
500 $this->assertSame( $canonicalOutput, $preparedEdit->output );
501 $this->assertSame(
$updater->getRawContent( SlotRecord::MAIN ), $preparedEdit->pstContent );
502 $this->assertSame(
$updater->getCanonicalParserOptions(), $preparedEdit->popts );
503 $this->assertSame(
$rev->getId(), $preparedEdit->revid );
508 $page = $this->
getPage( __METHOD__ );
514 $update->modifyContent( SlotRecord::MAIN, $mainContent1 );
516 $updater->prepareContent( $user, $update,
false );
518 $dataUpdates =
$updater->getSecondaryDataUpdates();
520 $this->assertNotEmpty( $dataUpdates );
522 $linksUpdates = array_filter( $dataUpdates,
function ( $du ) {
525 $this->assertCount( 1, $linksUpdates );
535 $handler = $this->getMockBuilder( TextContentHandler::class )
536 ->setConstructorArgs( [ $name ] )
538 [
'getSecondaryDataUpdates',
'getDeletionUpdates',
'unserializeContent' ]
543 $dataUpdate->_name =
"$name data update";
546 $deletionUpdate->_name =
"$name deletion update";
548 $handler->method(
'getSecondaryDataUpdates' )->willReturn( [ $dataUpdate ] );
549 $handler->method(
'getDeletionUpdates' )->willReturn( [ $deletionUpdate ] );
550 $handler->method(
'unserializeContent' )->willReturnCallback(
551 function ( $text ) use (
$handler ) {
557 'wgContentHandlers', [
558 $name =>
function () use (
$handler ){
575 $content = $this->getMockBuilder( TextContent::class )
576 ->setConstructorArgs( [ $text ] )
577 ->setMethods( [
'getModel',
'getContentHandler' ] )
590 $this->markTestSkipped(
'Slot removal cannot happen with MCR being enabled' );
602 $page = $this->
getPage( __METHOD__ );
606 [
'main' => $mainContent1,
'aux' => $auxContent1 ]
610 $update->modifyContent( SlotRecord::MAIN, $mainContent2 );
611 $update->removeSlot(
'aux' );
613 $page = $this->
getPage( __METHOD__ );
615 $updater->prepareContent( $user, $update,
false );
617 $dataUpdates =
$updater->getSecondaryDataUpdates();
619 $this->assertNotEmpty( $dataUpdates );
621 $updateNames = array_map(
function ( $du ) {
622 return isset( $du->_name ) ? $du->_name : get_class( $du );
625 $this->assertContains( LinksUpdate::class, $updateNames );
626 $this->assertContains(
'A1 deletion update', $updateNames );
627 $this->assertContains(
'M2 data update', $updateNames );
628 $this->assertNotContains(
'M1 data update', $updateNames );
653 $rev->applyUpdate( $update );
654 $rev->setUser( $user );
655 $rev->setComment( CommentStoreComment::newUnsavedComment( $comment ) );
656 $rev->setPageId( $title->getArticleID() );
657 $rev->setParentId( $parentId );
671 $mock = $this->getMockBuilder( Title::class )
672 ->disableOriginalConstructor()
674 $mock->expects( $this->
any() )
675 ->method(
'getDBkey' )
676 ->will( $this->returnValue( __CLASS__ ) );
677 $mock->expects( $this->
any() )
678 ->method(
'getArticleID' )
679 ->will( $this->returnValue( $id ) );
694 $update1->modifyContent( SlotRecord::MAIN, $content1 );
697 $update1b->modifyContent(
'xyz', $content1 );
700 $update2->modifyContent( SlotRecord::MAIN, $content2 );
702 $rev1 = $this->
makeRevision( $title, $update1, $user1,
'rev1', 11 );
703 $rev1b = $this->
makeRevision( $title, $update1b, $user1,
'rev1', 11 );
705 $rev2 = $this->
makeRevision( $title, $update2, $user1,
'rev2', 12 );
706 $rev2x = $this->
makeRevision( $title, $update2, $user2,
'rev2', 12 );
707 $rev2y = $this->
makeRevision( $title, $update2, $user1,
'rev2', 122 );
711 '$prepRevision' =>
null,
712 '$prepUpdate' =>
null,
714 '$forRevision' =>
null,
715 '$forUpdate' =>
null,
716 '$forParent' =>
null,
717 '$isReusable' =>
true,
720 '$prepUser' => $user1,
721 '$prepRevision' => $rev1,
722 '$prepUpdate' => $update1,
724 '$forRevision' =>
null,
725 '$forUpdate' =>
null,
726 '$forParent' =>
null,
727 '$isReusable' =>
true,
729 yield
'unprepared' => [
731 '$prepRevision' =>
null,
732 '$prepUpdate' =>
null,
733 '$forUser' => $user1,
734 '$forRevision' => $rev1,
735 '$forUpdate' => $update1,
737 '$isReusable' =>
true,
739 yield
'match prepareContent' => [
740 '$prepUser' => $user1,
741 '$prepRevision' =>
null,
742 '$prepUpdate' => $update1,
743 '$forUser' => $user1,
744 '$forRevision' =>
null,
745 '$forUpdate' => $update1,
747 '$isReusable' =>
true,
749 yield
'match prepareUpdate' => [
751 '$prepRevision' => $rev1,
752 '$prepUpdate' =>
null,
753 '$forUser' => $user1,
754 '$forRevision' => $rev1,
755 '$forUpdate' =>
null,
757 '$isReusable' =>
true,
759 yield
'match all' => [
760 '$prepUser' => $user1,
761 '$prepRevision' => $rev1,
762 '$prepUpdate' => $update1,
763 '$forUser' => $user1,
764 '$forRevision' => $rev1,
765 '$forUpdate' => $update1,
767 '$isReusable' =>
true,
769 yield
'mismatch prepareContent update' => [
770 '$prepUser' => $user1,
771 '$prepRevision' =>
null,
772 '$prepUpdate' => $update1,
773 '$forUser' => $user1,
774 '$forRevision' =>
null,
775 '$forUpdate' => $update1b,
777 '$isReusable' =>
false,
779 yield
'mismatch prepareContent user' => [
780 '$prepUser' => $user1,
781 '$prepRevision' =>
null,
782 '$prepUpdate' => $update1,
783 '$forUser' => $user2,
784 '$forRevision' =>
null,
785 '$forUpdate' => $update1,
787 '$isReusable' =>
false,
789 yield
'mismatch prepareContent parent' => [
790 '$prepUser' => $user1,
791 '$prepRevision' =>
null,
792 '$prepUpdate' => $update1,
793 '$forUser' => $user1,
794 '$forRevision' =>
null,
795 '$forUpdate' => $update1,
797 '$isReusable' =>
false,
799 yield
'mismatch prepareUpdate revision update' => [
801 '$prepRevision' => $rev1,
802 '$prepUpdate' =>
null,
804 '$forRevision' => $rev1b,
805 '$forUpdate' =>
null,
807 '$isReusable' =>
false,
809 yield
'mismatch prepareUpdate revision user' => [
811 '$prepRevision' => $rev2,
812 '$prepUpdate' =>
null,
814 '$forRevision' => $rev2x,
815 '$forUpdate' =>
null,
817 '$isReusable' =>
false,
819 yield
'mismatch prepareUpdate revision id' => [
821 '$prepRevision' => $rev2,
822 '$prepUpdate' =>
null,
824 '$forRevision' => $rev2y,
825 '$forUpdate' =>
null,
827 '$isReusable' =>
false,
845 User $prepUser =
null,
848 User $forUser =
null,
857 $updater->prepareContent( $prepUser, $prepUpdate,
false );
860 if ( $prepRevision ) {
861 $updater->prepareUpdate( $prepRevision );
866 $updater->isReusableFor( $forUser, $forRevision, $forUpdate, $forParent )
876 $page = $this->
getPage( __METHOD__ );
881 $content[
'aux'] =
new WikitextContent(
'Aux [[Nix]]' );
885 $pageId = $page->getId();
887 $oldStats = $this->db->selectRow(
'site_stats',
'*',
'1=1' );
888 $this->db->delete(
'pagelinks',
'*' );
891 $pcache->deleteOptionsKey( $page );
894 $updater->setArticleCountMethod(
'link' );
902 $pageLinks = $this->db->select(
905 [
'pl_from' => $pageId ],
907 [
'ORDER BY' =>
'pl_namespace, pl_title' ]
910 $pageLinksRow = $pageLinks->fetchObject();
911 $this->assertInternalType(
'object', $pageLinksRow );
912 $this->assertSame(
'Main', $pageLinksRow->pl_title );
915 $pageLinksRow = $pageLinks->fetchObject();
916 $this->assertInternalType(
'object', $pageLinksRow );
917 $this->assertSame(
'Nix', $pageLinksRow->pl_title );
921 $cached = $pcache->get( $page,
$updater->getCanonicalParserOptions() );
922 $this->assertInternalType(
'object', $cached );
923 $this->assertSame(
$updater->getCanonicalParserOutput(), $cached );
926 $stats = $this->db->selectRow(
'site_stats',
'*',
'1=1' );
927 $this->assertSame( $oldStats->ss_total_pages + 1, (
int)$stats->ss_total_pages );
928 $this->assertSame( $oldStats->ss_total_edits + 1, (
int)$stats->ss_total_edits );
929 $this->assertSame( $oldStats->ss_good_articles + 1, (
int)$stats->ss_good_articles );
946 $page = $this->
getPage( __METHOD__ );
952 $update->modifyContent(
'main',
new WikitextContent(
'first [[Main]]' ) );
960 $pcache->deleteOptionsKey( $page );
962 $rev = $this->
makeRevision( $page->getTitle(), $update, $user,
'rev',
null );
963 $rev->setTimestamp(
'20100101000000' );
964 $rev->setParentId( $page->getLatest() );
967 $updater->prepareContent( $user, $update,
false );
974 $page->setTimestamp(
$rev->getTimestamp() );
978 $cached = $pcache->get( $page,
$updater->getCanonicalParserOptions(),
true );
979 $this->assertInternalType(
'object', $cached );
980 $this->assertSame(
$updater->getCanonicalParserOutput(), $cached );
982 $this->assertSame(
$rev->getTimestamp(), $cached->getCacheTime() );
983 $this->assertSame(
$rev->getId(), $cached->getCacheRevisionId() );
986 $pcache->deleteOptionsKey( $page );
993 $page->setTimestamp(
$rev->getTimestamp() );
997 $cached = $pcache->get( $page,
$updater->getCanonicalParserOptions(),
true );
998 $this->assertInternalType(
'object', $cached );
999 $this->assertSame(
$updater->getCanonicalParserOutput(), $cached );
1001 $this->assertGreaterThan(
$rev->getTimestamp(), $cached->getCacheTime() );
1002 $this->assertSame(
$rev->getId(), $cached->getCacheRevisionId() );
they could even be mouse clicks or menu items whatever suits your program You should also get your if any
int $wgMultiContentRevisionSchemaMigrationStage
RevisionStore table schema migration stage (content, slots, content_models & slot_roles tables).
A content handler knows how do deal with a specific type of content on a wiki page.
Class the manages updates of *_link tables as well as similar extension-managed tables.
Deferrable Update for closure/callback.
Library for creating and parsing MW-style timestamps.
A handle for managing updates for derived page data on edit, import, purge, etc.
defineMockContentModelForUpdateTesting( $name)
testIsReusableFor(User $prepUser=null, RevisionRecord $prepRevision=null, RevisionSlotsUpdate $prepUpdate=null, User $forUser=null, RevisionRecord $forRevision=null, RevisionSlotsUpdate $forUpdate=null, $forParent=null, $isReusable=null)
provideIsReusableFor \MediaWiki\Storage\DerivedPageDataUpdater::isReusableFor()
testDoUpdates()
\MediaWiki\Storage\DerivedPageDataUpdater::doUpdates() \MediaWiki\Storage\DerivedPageDataUpdater::doS...
testGrabCurrentRevision()
\MediaWiki\Storage\DerivedPageDataUpdater::grabCurrentRevision() \MediaWiki\Storage\DerivedPageDataUp...
getDerivedPageDataUpdater( $page, RevisionRecord $rec=null)
makeRevision(Title $title, RevisionSlotsUpdate $update, User $user, $comment, $id=0, $parentId=0)
Creates a dummy revision object without touching the database.
testPrepareUpdateReusesParserOutput()
\MediaWiki\Storage\DerivedPageDataUpdater::prepareUpdate()
testPrepareUpdate()
\MediaWiki\Storage\DerivedPageDataUpdater::prepareUpdate() \MediaWiki\Storage\DerivedPageDataUpdater:...
testGetPreparedEditAfterPrepareUpdate()
\MediaWiki\Storage\DerivedPageDataUpdater::getPreparedEdit()
createMockContent(ContentHandler $handler, $text)
testPrepareContentInherit()
\MediaWiki\Storage\DerivedPageDataUpdater::prepareContent() \MediaWiki\Storage\DerivedPageDataUpdater...
createRevision(WikiPage $page, $summary, $content=null)
Creates a revision in the database.
testPrepareContent()
\MediaWiki\Storage\DerivedPageDataUpdater::prepareContent() \MediaWiki\Storage\DerivedPageDataUpdater...
testGetSecondaryDataUpdatesAfterPrepareContent()
testGetSecondaryDataUpdatesWithSlotRemoval()
testPrepareUpdateOutputReset()
\MediaWiki\Storage\DerivedPageDataUpdater::prepareUpdate() \MediaWiki\Storage\DerivedPageDataUpdater:...
testGetPreparedEditAfterPrepareContent()
\MediaWiki\Storage\DerivedPageDataUpdater::getPreparedEdit()
testDoParserCacheUpdate()
\MediaWiki\Storage\DerivedPageDataUpdater::doParserCacheUpdate()
testGetCanonicalParserOptions()
\MediaWiki\Storage\DerivedPageDataUpdater::getCanonicalParserOptions()
Base content handler implementation for flat text contents.
Content object implementation for representing flat text.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Class representing a MediaWiki article and history.
Content object for wiki text pages.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves $handler
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
const SCHEMA_COMPAT_READ_NEW
const SCHEMA_COMPAT_WRITE_NEW
Base interface for content objects.
$page->newPageUpdater($user) $updater