MediaWiki  master
WikiPageDbTestBase Class Reference

WikiPage. More...

Inheritance diagram for WikiPageDbTestBase:
Collaboration diagram for WikiPageDbTestBase:

Public Member Functions

 __construct ( $name=null, array $data=[], $dataName='')
 
 dataReplaceSection ()
 
 provideGetAutoDeleteReason ()
 
 provideGetParserOutput ()
 
 provideGetRedirectTarget ()
 
 provideHasViewableContent ()
 
 provideIsCountable ()
 
 provideNewFromRowSuccess ()
 
 providePreSaveTransform ()
 
 provideTestDoUpdateRestrictions_setBasicRestrictions ()
 
 provideTestInsertProtectNullRevision ()
 
 provideTestNewFromId_returnsNullOnBadPageId ()
 
 provideUpdateRedirectOn ()
 
 testDoDeleteArticle ()
 Undeletion is covered in PageArchiveTest::testUndeleteRevisions() TODO: Revision deletion. More...
 
 testDoDeleteArticleReal_suppress ()
 TODO: Test more stuff about suppression. More...
 
 testDoDeleteArticleReal_user0 ()
 WikiPage::doDeleteArticleReal. More...
 
 testDoDeleteArticleReal_userSysop ()
 WikiPage::doDeleteArticleReal. More...
 
 testDoDeleteUpdates ()
 WikiPage::doDeleteUpdates. More...
 
 testDoEditContent ()
 WikiPage::doEditContent WikiPage::prepareContentForEdit. More...
 
 testDoEditContent_twice ()
 WikiPage::doEditContent. More...
 
 testDoEditUpdates ()
 WikiPage::doEditUpdates. More...
 
 testDoRollback ()
 WikiPage::doRollback WikiPage::commitRollback More...
 
 testDoRollbackFailureSameContent ()
 WikiPage::doRollback WikiPage::commitRollback More...
 
 testDoRollbackTagging ()
 Tests tagging for edits that do rollback action WikiPage::doRollback. More...
 
 testDoUpdateRestrictions_failsOnReadOnly ()
 WikiPage::doUpdateRestrictions More...
 
 testDoUpdateRestrictions_logEntryTypeAndAction ()
 WikiPage::doUpdateRestrictions More...
 
 testDoUpdateRestrictions_returnsGoodIfNothingChanged ()
 WikiPage::doUpdateRestrictions More...
 
 testDoUpdateRestrictions_setBasicRestrictions ( $pageExists, array $limit, array $expiry, array $expectedRestrictions, array $expectedRestrictionExpiries)
 provideTestDoUpdateRestrictions_setBasicRestrictions WikiPage::doUpdateRestrictions More...
 
 testExists ()
 WikiPage::exists. More...
 
 testGetAutoDeleteReason ( $edits, $expectedResult, $expectedHistory)
 provideGetAutoDeleteReason WikiPage::getAutoDeleteReason More...
 
 testGetContent ()
 WikiPage::getContent. More...
 
 testGetDeletionUpdates ()
 
 testGetDerivedDataUpdater ()
 WikiPage::newPageUpdater WikiPage::getDerivedDataUpdater More...
 
 testGetOldestRevision ()
 WikiPage::getOldestRevision More...
 
 testGetParserOutput ( $model, $text, $expectedHtml)
 provideGetParserOutput WikiPage::getParserOutput More...
 
 testGetParserOutput_badrev ()
 WikiPage::getParserOutput More...
 
 testGetParserOutput_nonexisting ()
 WikiPage::getParserOutput More...
 
 testGetRedirectTarget ( $title, $model, $text, $target)
 provideGetRedirectTarget WikiPage::getRedirectTarget More...
 
 testGetRevision ()
 WikiPage::getRevision. More...
 
 testHasViewableContent ( $title, $viewable, $create=false)
 provideHasViewableContent WikiPage::hasViewableContent More...
 
 testInsertOn ()
 WikiPage::insertOn More...
 
 testInsertOn_idSpecified ()
 WikiPage::insertOn More...
 
 testInsertProtectNullRevision ( $revCommentMsg, array $limit, array $expiry, $cascade, $reason, $user, $expectedComment)
 provideTestInsertProtectNullRevision WikiPage::insertProtectNullRevision WikiPage::protectDescription More...
 
 testInsertRedirectEntry_doesNotInsertIfPageLatestIncorrect ()
 WikiPage::insertRedirectEntry More...
 
 testInsertRedirectEntry_insertsRedirectEntry ()
 WikiPage::insertRedirectEntry More...
 
 testInsertRedirectEntry_insertsRedirectEntryWithPageLatest ()
 WikiPage::insertRedirectEntry More...
 
 testIsCountable ( $title, $model, $text, $mode, $expected)
 provideIsCountable WikiPage::isCountable More...
 
 testIsRedirect ( $title, $model, $text, $target)
 provideGetRedirectTarget WikiPage::isRedirect More...
 
 testLoadPageData ()
 WikiPage::loadPageData WikiPage::wasLoadedFrom More...
 
 testNewFromId_appearsToFetchCorrectRow ()
 WikiPage::newFromID More...
 
 testNewFromId_returnsNullOnBadPageId ( $pageId)
 WikiPage::newFromID provideTestNewFromId_returnsNullOnBadPageId More...
 
 testNewFromId_returnsNullOnNonExistingId ()
 WikiPage::newFromID More...
 
 testNewFromRow ( $row, $assertions)
 WikiPage::newFromRow WikiPage::loadFromRow provideNewFromRowSuccess More...
 
 testNewPageUpdater ()
 WikiPage::newPageUpdater WikiPage::getDerivedDataUpdater More...
 
 testPrepareContentForEdit ()
 WikiPage::prepareContentForEdit. More...
 
 testReplaceSectionAtRev ( $title, $model, $text, $section, $with, $sectionTitle, $expected)
 dataReplaceSection WikiPage::replaceSectionAtRev More...
 
 testReplaceSectionContent ( $title, $model, $text, $section, $with, $sectionTitle, $expected)
 dataReplaceSection WikiPage::replaceSectionContent More...
 
 testUpdateCategoryCounts ()
 WikiPage::updateCategoryCounts More...
 
 testUpdateIfNewerOn_newerRevision ()
 WikiPage::updateIfNewerOn More...
 
 testUpdateIfNewerOn_olderRevision ()
 WikiPage::updateIfNewerOn More...
 
 testUpdateRedirectOn ( $initialText, $initialRedirectState, $redirectTitle, $lastRevIsRedirect, $expectedSuccess, $expectedRowCount)
 provideUpdateRedirectOn WikiPage::updateRedirectOn More...
 
 testUpdateRevisionOn_existingPage ()
 WikiPage::updateRevisionOn More...
 
 testUpdateRevisionOn_NonExistingPage ()
 WikiPage::updateRevisionOn More...
 
 testWikiPageFactory ()
 WikiPage::factory More...
 

Static Public Attributes

static $sections
 

Protected Member Functions

 addCoreDBData ()
 
 assertPreparedEditEquals (PreparedEdit $edit, PreparedEdit $edit2, $message='')
 
 assertPreparedEditNotEquals (PreparedEdit $edit, PreparedEdit $edit2, $message='')
 
 createMockContent (ContentHandler $handler, $text)
 
 createPage ( $page, $content, $model=null, $user=null)
 
 defineMockContentModelForUpdateTesting ( $name)
 
 getContentHandlerUseDB ()
 
 getMcrMigrationStage ()
 
 getMcrTablesToReset ()
 
 setUp ()
 
 tearDown ()
 
- Protected Member Functions inherited from MediaWikiLangTestCase
 setUp ()
 

Private Member Functions

 assertRedirectTableCountForPageId ( $pageId, $expected)
 
 getRow (array $overrides=[])
 
 newPage ( $title, $model=null)
 

Private Attributes

 $pagesToDelete
 

Detailed Description

WikiPage.

Definition at line 13 of file WikiPageDbTestBase.php.

Constructor & Destructor Documentation

◆ __construct()

WikiPageDbTestBase::__construct (   $name = null,
array  $data = [],
  $dataName = '' 
)

Definition at line 17 of file WikiPageDbTestBase.php.

References $name.

Member Function Documentation

◆ addCoreDBData()

WikiPageDbTestBase::addCoreDBData ( )
protected

Definition at line 43 of file WikiPageDbTestBase.php.

References getMcrMigrationStage(), and getMcrTablesToReset().

◆ assertPreparedEditEquals()

WikiPageDbTestBase::assertPreparedEditEquals ( PreparedEdit  $edit,
PreparedEdit  $edit2,
  $message = '' 
)
protected

Definition at line 2445 of file WikiPageDbTestBase.php.

Referenced by testPrepareContentForEdit().

◆ assertPreparedEditNotEquals()

WikiPageDbTestBase::assertPreparedEditNotEquals ( PreparedEdit  $edit,
PreparedEdit  $edit2,
  $message = '' 
)
protected

Definition at line 2456 of file WikiPageDbTestBase.php.

Referenced by testPrepareContentForEdit().

◆ assertRedirectTableCountForPageId()

WikiPageDbTestBase::assertRedirectTableCountForPageId (   $pageId,
  $expected 
)
private

Definition at line 1643 of file WikiPageDbTestBase.php.

◆ createMockContent()

WikiPageDbTestBase::createMockContent ( ContentHandler  $handler,
  $text 
)
protected

◆ createPage()

◆ dataReplaceSection()

WikiPageDbTestBase::dataReplaceSection ( )

Definition at line 1054 of file WikiPageDbTestBase.php.

◆ defineMockContentModelForUpdateTesting()

WikiPageDbTestBase::defineMockContentModelForUpdateTesting (   $name)
protected
Parameters
string$name
Returns
ContentHandler

Definition at line 650 of file WikiPageDbTestBase.php.

References $handler, $name, class, createMockContent(), and use.

Referenced by WikiPageMcrReadNewDbTest\testGetDeletionUpdates(), and testGetDeletionUpdates().

◆ getContentHandlerUseDB()

WikiPageDbTestBase::getContentHandlerUseDB ( )
abstractprotected

Referenced by setUp(), and tearDown().

◆ getMcrMigrationStage()

WikiPageDbTestBase::getMcrMigrationStage ( )
abstractprotected
Returns
int

Referenced by addCoreDBData(), and setUp().

◆ getMcrTablesToReset()

WikiPageDbTestBase::getMcrTablesToReset ( )
abstractprotected
Returns
string[]

Referenced by addCoreDBData(), and setUp().

◆ getRow()

WikiPageDbTestBase::getRow ( array  $overrides = [])
private

Definition at line 1716 of file WikiPageDbTestBase.php.

◆ newPage()

WikiPageDbTestBase::newPage (   $title,
  $model = null 
)
private
Parameters
Title | string$title
string | null$model
Returns
WikiPage

Definition at line 94 of file WikiPageDbTestBase.php.

References $title, and Title\newFromText().

Referenced by createPage(), testDoEditContent(), testExists(), testGetContent(), testGetRevision(), and testHasViewableContent().

◆ provideGetAutoDeleteReason()

WikiPageDbTestBase::provideGetAutoDeleteReason ( )

Definition at line 1395 of file WikiPageDbTestBase.php.

◆ provideGetParserOutput()

WikiPageDbTestBase::provideGetParserOutput ( )

Definition at line 984 of file WikiPageDbTestBase.php.

References CONTENT_MODEL_WIKITEXT.

◆ provideGetRedirectTarget()

WikiPageDbTestBase::provideGetRedirectTarget ( )

Definition at line 808 of file WikiPageDbTestBase.php.

References CONTENT_MODEL_WIKITEXT, and null.

◆ provideHasViewableContent()

WikiPageDbTestBase::provideHasViewableContent ( )

Definition at line 781 of file WikiPageDbTestBase.php.

References false, and true.

◆ provideIsCountable()

WikiPageDbTestBase::provideIsCountable ( )

Definition at line 866 of file WikiPageDbTestBase.php.

References CONTENT_MODEL_WIKITEXT, false, null, and true.

◆ provideNewFromRowSuccess()

WikiPageDbTestBase::provideNewFromRowSuccess ( )

Definition at line 1734 of file WikiPageDbTestBase.php.

◆ providePreSaveTransform()

WikiPageDbTestBase::providePreSaveTransform ( )

Definition at line 1500 of file WikiPageDbTestBase.php.

◆ provideTestDoUpdateRestrictions_setBasicRestrictions()

WikiPageDbTestBase::provideTestDoUpdateRestrictions_setBasicRestrictions ( )

Definition at line 2108 of file WikiPageDbTestBase.php.

◆ provideTestInsertProtectNullRevision()

WikiPageDbTestBase::provideTestInsertProtectNullRevision ( )

Definition at line 1835 of file WikiPageDbTestBase.php.

◆ provideTestNewFromId_returnsNullOnBadPageId()

WikiPageDbTestBase::provideTestNewFromId_returnsNullOnBadPageId ( )

Definition at line 1802 of file WikiPageDbTestBase.php.

◆ provideUpdateRedirectOn()

WikiPageDbTestBase::provideUpdateRedirectOn ( )

Definition at line 1594 of file WikiPageDbTestBase.php.

◆ setUp()

WikiPageDbTestBase::setUp ( )
protected

◆ tearDown()

WikiPageDbTestBase::tearDown ( )
protected

Definition at line 72 of file WikiPageDbTestBase.php.

References as, and getContentHandlerUseDB().

◆ testDoDeleteArticle()

WikiPageDbTestBase::testDoDeleteArticle ( )

◆ testDoDeleteArticleReal_suppress()

WikiPageDbTestBase::testDoDeleteArticleReal_suppress ( )

◆ testDoDeleteArticleReal_user0()

WikiPageDbTestBase::testDoDeleteArticleReal_user0 ( )

◆ testDoDeleteArticleReal_userSysop()

WikiPageDbTestBase::testDoDeleteArticleReal_userSysop ( )

◆ testDoDeleteUpdates()

◆ testDoEditContent()

◆ testDoEditContent_twice()

WikiPageDbTestBase::testDoEditContent_twice ( )

◆ testDoEditUpdates()

WikiPageDbTestBase::testDoEditUpdates ( )

◆ testDoRollback()

WikiPageDbTestBase::testDoRollback ( )

◆ testDoRollbackFailureSameContent()

WikiPageDbTestBase::testDoRollbackFailureSameContent ( )

◆ testDoRollbackTagging()

WikiPageDbTestBase::testDoRollbackTagging ( )

Tests tagging for edits that do rollback action WikiPage::doRollback.

Definition at line 1344 of file WikiPageDbTestBase.php.

◆ testDoUpdateRestrictions_failsOnReadOnly()

WikiPageDbTestBase::testDoUpdateRestrictions_failsOnReadOnly ( )

◆ testDoUpdateRestrictions_logEntryTypeAndAction()

WikiPageDbTestBase::testDoUpdateRestrictions_logEntryTypeAndAction ( )

◆ testDoUpdateRestrictions_returnsGoodIfNothingChanged()

WikiPageDbTestBase::testDoUpdateRestrictions_returnsGoodIfNothingChanged ( )

◆ testDoUpdateRestrictions_setBasicRestrictions()

WikiPageDbTestBase::testDoUpdateRestrictions_setBasicRestrictions (   $pageExists,
array  $limit,
array  $expiry,
array  $expectedRestrictions,
array  $expectedRestrictionExpiries 
)

provideTestDoUpdateRestrictions_setBasicRestrictions WikiPage::doUpdateRestrictions

Definition at line 2165 of file WikiPageDbTestBase.php.

◆ testExists()

WikiPageDbTestBase::testExists ( )

◆ testGetAutoDeleteReason()

WikiPageDbTestBase::testGetAutoDeleteReason (   $edits,
  $expectedResult,
  $expectedHistory 
)

provideGetAutoDeleteReason WikiPage::getAutoDeleteReason

Definition at line 1461 of file WikiPageDbTestBase.php.

◆ testGetContent()

WikiPageDbTestBase::testGetContent ( )

◆ testGetDeletionUpdates()

WikiPageDbTestBase::testGetDeletionUpdates ( )

◆ testGetDerivedDataUpdater()

WikiPageDbTestBase::testGetDerivedDataUpdater ( )

◆ testGetOldestRevision()

WikiPageDbTestBase::testGetOldestRevision ( )

◆ testGetParserOutput()

WikiPageDbTestBase::testGetParserOutput (   $model,
  $text,
  $expectedHtml 
)

provideGetParserOutput WikiPage::getParserOutput

Definition at line 999 of file WikiPageDbTestBase.php.

References $opt, and createPage().

◆ testGetParserOutput_badrev()

WikiPageDbTestBase::testGetParserOutput_badrev ( )

◆ testGetParserOutput_nonexisting()

WikiPageDbTestBase::testGetParserOutput_nonexisting ( )

◆ testGetRedirectTarget()

WikiPageDbTestBase::testGetRedirectTarget (   $title,
  $model,
  $text,
  $target 
)

provideGetRedirectTarget WikiPage::getRedirectTarget

Definition at line 841 of file WikiPageDbTestBase.php.

References $t, $title, class, createPage(), and null.

◆ testGetRevision()

WikiPageDbTestBase::testGetRevision ( )

◆ testHasViewableContent()

WikiPageDbTestBase::testHasViewableContent (   $title,
  $viewable,
  $create = false 
)

provideHasViewableContent WikiPage::hasViewableContent

Definition at line 795 of file WikiPageDbTestBase.php.

References $title, CONTENT_MODEL_WIKITEXT, createPage(), and newPage().

◆ testInsertOn()

WikiPageDbTestBase::testInsertOn ( )

WikiPage::insertOn

Definition at line 2028 of file WikiPageDbTestBase.php.

◆ testInsertOn_idSpecified()

WikiPageDbTestBase::testInsertOn_idSpecified ( )

WikiPage::insertOn

Definition at line 2088 of file WikiPageDbTestBase.php.

◆ testInsertProtectNullRevision()

WikiPageDbTestBase::testInsertProtectNullRevision (   $revCommentMsg,
array  $limit,
array  $expiry,
  $cascade,
  $reason,
  $user,
  $expectedComment 
)

provideTestInsertProtectNullRevision WikiPage::insertProtectNullRevision WikiPage::protectDescription

Parameters
string$revCommentMsg
array$limit
array$expiry
bool$cascade
string$reason
bool | null$usertrue if the test sysop should be used, or null
string$expectedComment

Definition at line 1871 of file WikiPageDbTestBase.php.

◆ testInsertRedirectEntry_doesNotInsertIfPageLatestIncorrect()

WikiPageDbTestBase::testInsertRedirectEntry_doesNotInsertIfPageLatestIncorrect ( )

◆ testInsertRedirectEntry_insertsRedirectEntry()

WikiPageDbTestBase::testInsertRedirectEntry_insertsRedirectEntry ( )

◆ testInsertRedirectEntry_insertsRedirectEntryWithPageLatest()

WikiPageDbTestBase::testInsertRedirectEntry_insertsRedirectEntryWithPageLatest ( )

◆ testIsCountable()

WikiPageDbTestBase::testIsCountable (   $title,
  $model,
  $text,
  $mode,
  $expected 
)

◆ testIsRedirect()

WikiPageDbTestBase::testIsRedirect (   $title,
  $model,
  $text,
  $target 
)

provideGetRedirectTarget WikiPage::isRedirect

Definition at line 861 of file WikiPageDbTestBase.php.

References $title, and createPage().

◆ testLoadPageData()

WikiPageDbTestBase::testLoadPageData ( )

◆ testNewFromId_appearsToFetchCorrectRow()

WikiPageDbTestBase::testNewFromId_appearsToFetchCorrectRow ( )

WikiPage::newFromID

Definition at line 1818 of file WikiPageDbTestBase.php.

◆ testNewFromId_returnsNullOnBadPageId()

WikiPageDbTestBase::testNewFromId_returnsNullOnBadPageId (   $pageId)

WikiPage::newFromID provideTestNewFromId_returnsNullOnBadPageId

Definition at line 1811 of file WikiPageDbTestBase.php.

◆ testNewFromId_returnsNullOnNonExistingId()

WikiPageDbTestBase::testNewFromId_returnsNullOnNonExistingId ( )

WikiPage::newFromID

Definition at line 1831 of file WikiPageDbTestBase.php.

◆ testNewFromRow()

WikiPageDbTestBase::testNewFromRow (   $row,
  $assertions 
)

WikiPage::newFromRow WikiPage::loadFromRow provideNewFromRowSuccess

Parameters
object$row
callable$assertions

Definition at line 1797 of file WikiPageDbTestBase.php.

◆ testNewPageUpdater()

WikiPageDbTestBase::testNewPageUpdater ( )

◆ testPrepareContentForEdit()

◆ testReplaceSectionAtRev()

WikiPageDbTestBase::testReplaceSectionAtRev (   $title,
  $model,
  $text,
  $section,
  $with,
  $sectionTitle,
  $expected 
)

dataReplaceSection WikiPage::replaceSectionAtRev

Definition at line 1122 of file WikiPageDbTestBase.php.

◆ testReplaceSectionContent()

WikiPageDbTestBase::testReplaceSectionContent (   $title,
  $model,
  $text,
  $section,
  $with,
  $sectionTitle,
  $expected 
)

dataReplaceSection WikiPage::replaceSectionContent

Definition at line 1106 of file WikiPageDbTestBase.php.

◆ testUpdateCategoryCounts()

WikiPageDbTestBase::testUpdateCategoryCounts ( )

◆ testUpdateIfNewerOn_newerRevision()

WikiPageDbTestBase::testUpdateIfNewerOn_newerRevision ( )

◆ testUpdateIfNewerOn_olderRevision()

WikiPageDbTestBase::testUpdateIfNewerOn_olderRevision ( )

◆ testUpdateRedirectOn()

WikiPageDbTestBase::testUpdateRedirectOn (   $initialText,
  $initialRedirectState,
  $redirectTitle,
  $lastRevIsRedirect,
  $expectedSuccess,
  $expectedRowCount 
)

provideUpdateRedirectOn WikiPage::updateRedirectOn

Parameters
string$initialText
bool$initialRedirectState
string | null$redirectTitle
bool | null$lastRevIsRedirect
bool$expectedSuccess
int$expectedRowCount

Definition at line 1612 of file WikiPageDbTestBase.php.

◆ testUpdateRevisionOn_existingPage()

WikiPageDbTestBase::testUpdateRevisionOn_existingPage ( )

◆ testUpdateRevisionOn_NonExistingPage()

WikiPageDbTestBase::testUpdateRevisionOn_NonExistingPage ( )

◆ testWikiPageFactory()

WikiPageDbTestBase::testWikiPageFactory ( )

WikiPage::factory

Definition at line 1514 of file WikiPageDbTestBase.php.

Member Data Documentation

◆ $pagesToDelete

WikiPageDbTestBase::$pagesToDelete
private

Definition at line 15 of file WikiPageDbTestBase.php.

◆ $sections

WikiPageDbTestBase::$sections
static
Initial value:
=
"Intro
== stuff ==
hello world
== test ==
just a test
== foo ==
more stuff
"

Definition at line 1040 of file WikiPageDbTestBase.php.


The documentation for this class was generated from the following file: