MediaWiki  1.23.2
WikiPageTest Class Reference

@group ContentHandler @group Database ^— important, causes temporary tables to be used instead of the real database @group medium More...

Inheritance diagram for WikiPageTest:
Collaboration diagram for WikiPageTest:

Public Member Functions

 __construct ( $name=null, array $data=array(), $dataName='')
 
 broken_testDoRollback ()
 
 dataReplaceSection ()
 
 testDoDeleteArticle ()
 @covers WikiPage::doDeleteArticle More...
 
 testDoDeleteUpdates ()
 @covers WikiPage::doDeleteUpdates More...
 
 testDoEdit ()
 @covers WikiPage::doEdit More...
 
 testDoEditContent ()
 @covers WikiPage::doEditContent More...
 
 testDoQuickEdit ()
 @covers WikiPage::doQuickEdit More...
 
 testDoQuickEditContent ()
 @covers WikiPage::doQuickEditContent More...
 
 testDoRollback ()
 
 testDoRollbackFailureSameContent ()
 @covers WikiPage::doRollback More...
 
 testExists ()
 @covers WikiPage::exists More...
 
 testGetAutoDeleteReason ( $edits, $expectedResult, $expectedHistory)
 @dataProvider provideGetAutoDeleteReason @covers WikiPage::getAutoDeleteReason More...
 
 testGetAutosummary ( $old, $new, $flags, $expected)
 @dataProvider provideGetAutoSummary @covers WikiPage::getAutosummary More...
 
 testGetContent ()
 @covers WikiPage::getContent More...
 
 testGetContentHandler ()
 @covers WikiPage::getContentHandler More...
 
 testGetContentModel ()
 @covers WikiPage::getContentModel More...
 
 testGetParserOutput ( $model, $text, $expectedHtml)
 @dataProvider provideGetParserOutput @covers WikiPage::getParserOutput More...
 
 testGetParserOutput_badrev ()
 @covers WikiPage::getParserOutput More...
 
 testGetParserOutput_nonexisting ()
 @covers WikiPage::getParserOutput More...
 
 testGetRawText ()
 @covers WikiPage::getRawText More...
 
 testGetRedirectTarget ( $title, $model, $text, $target)
 @dataProvider provideGetRedirectTarget @covers WikiPage::getRedirectTarget More...
 
 testGetRevision ()
 @covers WikiPage::getRevision More...
 
 testGetText ()
 @covers WikiPage::getText More...
 
 testHasViewableContent ( $title, $viewable, $create=false)
 @dataProvider provideHasViewableContent @covers WikiPage::hasViewableContent More...
 
 testIsCountable ( $title, $model, $text, $mode, $expected)
 @dataProvider provideIsCountable @covers WikiPage::isCountable More...
 
 testIsRedirect ( $title, $model, $text, $target)
 @dataProvider provideGetRedirectTarget @covers WikiPage::isRedirect More...
 
 testPreSaveTransform ( $text, $expected)
 @dataProvider providePreSaveTransform @covers WikiPage::preSaveTransform More...
 
 testReplaceSection ( $title, $model, $text, $section, $with, $sectionTitle, $expected)
 @dataProvider dataReplaceSection @covers WikiPage::replaceSection More...
 
 testReplaceSectionContent ( $title, $model, $text, $section, $with, $sectionTitle, $expected)
 @dataProvider dataReplaceSection @covers WikiPage::replaceSectionContent More...
 
 testWikiPageFactory ()
 @covers WikiPage::factory More...
 
- Public Member Functions inherited from MediaWikiTestCase
 __call ( $func, $args)
 
 addDBData ()
 Stub. More...
 
 dbPrefix ()
 
 getCliArg ( $offset)
 
 hideDeprecated ( $function)
 Don't throw a warning if $function is deprecated and called later. More...
 
 needsDB ()
 
 run (PHPUnit_Framework_TestResult $result=null)
 
 setCliArg ( $offset, $value)
 
 testMediaWikiTestCaseParentSetupCalled ()
 Make sure MediaWikiTestCase extending classes have called their parent setUp method. More...
 
 usesTemporaryTables ()
 

Static Public Member Functions

static provideGetAutoDeleteReason ()
 
static provideGetAutosummary ()
 
static provideGetParserOutput ()
 
static provideGetRedirectTarget ()
 
static provideHasViewableContent ()
 
static provideIsCountable ()
 
static providePreSaveTransform ()
 
- Static Public Member Functions inherited from MediaWikiTestCase
static listTables ( $db)
 
static setupTestDB (DatabaseBase $db, $prefix)
 Creates an empty skeleton of the wiki database by cloning its structure to equivalent tables using the given $prefix. More...
 
static teardownTestDB ()
 Restores MediaWiki to using the table set (table prefix) it was using before setupTestDB() was called. More...
 

Static Public Attributes

static $sections
 
- Static Public Attributes inherited from MediaWikiTestCase
static $users
 

Protected Member Functions

 createPage ( $page, $text, $model=null)
 
 newPage ( $title, $model=null)
 
 setUp ()
 
 tearDown ()
 
- Protected Member Functions inherited from MediaWikiTestCase
 arrayWrap (array $elements)
 Utility method taking an array of elements and wrapping each element in it's own array. More...
 
 assertArrayEquals (array $expected, array $actual, $ordered=false, $named=false)
 Assert that two arrays are equal. More...
 
 assertException ( $code, $expected='Exception', $message='')
 Asserts that an exception of the specified type occurs when running the provided code. More...
 
 assertHTMLEquals ( $expected, $actual, $msg='')
 Put each HTML element on its own line and then equals() the results. More...
 
 assertSelect ( $table, $fields, $condition, array $expectedRows)
 Asserts that the given database query yields the rows given by $expectedRows. More...
 
 assertType ( $type, $actual, $message='')
 Asserts the type of the provided value. More...
 
 assertTypeOrValue ( $type, $actual, $value=false, $message='')
 Asserts that the provided variable is of the specified internal type or equals the $value argument. More...
 
 assertValidHtmlDocument ( $html)
 Asserts that the given string is valid HTML document. More...
 
 assertValidHtmlSnippet ( $html)
 Asserts that the given string is a valid HTML snippet. More...
 
 checkDbIsSupported ()
 
 checkHasDiff3 ()
 Check, if $wgDiff3 is set and ready to merge Will mark the calling test as skipped, if not ready. More...
 
 checkHasGzip ()
 Check whether we have the 'gzip' commandline utility, will skip the test whenever "gzip -V" fails. More...
 
 checkPHPExtension ( $extName)
 Check if $extName is a loaded PHP extension, will skip the test whenever it is not loaded. More...
 
 getDefaultWikitextNS ()
 Returns the ID of a namespace that defaults to Wikitext. More...
 
 getNewTempDirectory ()
 obtains a new temporary directory More...
 
 getNewTempFile ()
 Obtains a new temporary file name. More...
 
 isWikitextNS ( $ns)
 Returns true if the given namespace defaults to Wikitext according to $wgNamespaceContentModels. More...
 
 mergeMwGlobalArrayValue ( $name, $values)
 Merges the given values into a MW global array variable. More...
 
 objectAssociativeSort (array &$array)
 Does an associative sort that works for objects. More...
 
 setMwGlobals ( $pairs, $value=null)
 
 stashMwGlobals ( $globalKeys)
 Stashes the global, will be restored in tearDown() More...
 

Protected Attributes

 $pages_to_delete
 
- Protected Attributes inherited from MediaWikiTestCase
DatabaseBase $db
 
array $supportedDBs
 
array $tablesUsed = array()
 

Additional Inherited Members

- Public Attributes inherited from MediaWikiTestCase
const DB_PREFIX = 'unittest_'
 Table name prefixes. More...
 
const ORA_DB_PREFIX = 'ut_'
 
- Static Protected Member Functions inherited from MediaWikiTestCase
static stripStringKeys (&$r)
 Utility function for eliminating all string keys from an array. More...
 

Detailed Description

@group ContentHandler @group Database ^— important, causes temporary tables to be used instead of the real database @group medium

Definition at line 9 of file WikiPageTest.php.

Constructor & Destructor Documentation

◆ __construct()

WikiPageTest::__construct (   $name = null,
array  $data = array(),
  $dataName = '' 
)

Reimplemented from MediaWikiTestCase.

Definition at line 13 of file WikiPageTest.php.

References $name, and array().

Member Function Documentation

◆ broken_testDoRollback()

WikiPageTest::broken_testDoRollback ( )
Todo:
FIXME: this is a better rollback test than the one below, but it keeps failing in jenkins for some reason.

Definition at line 798 of file WikiPageTest.php.

◆ createPage()

◆ dataReplaceSection()

WikiPageTest::dataReplaceSection ( )

Definition at line 678 of file WikiPageTest.php.

◆ newPage()

WikiPageTest::newPage (   $title,
  $model = null 
)
protected

◆ provideGetAutoDeleteReason()

static WikiPageTest::provideGetAutoDeleteReason ( )
static

Definition at line 986 of file WikiPageTest.php.

◆ provideGetAutosummary()

static WikiPageTest::provideGetAutosummary ( )
static

Definition at line 930 of file WikiPageTest.php.

◆ provideGetParserOutput()

static WikiPageTest::provideGetParserOutput ( )
static

Definition at line 609 of file WikiPageTest.php.

References array(), and CONTENT_MODEL_WIKITEXT.

◆ provideGetRedirectTarget()

static WikiPageTest::provideGetRedirectTarget ( )
static

Definition at line 440 of file WikiPageTest.php.

References array(), and CONTENT_MODEL_WIKITEXT.

◆ provideHasViewableContent()

static WikiPageTest::provideHasViewableContent ( )
static

Definition at line 413 of file WikiPageTest.php.

References array().

◆ provideIsCountable()

static WikiPageTest::provideIsCountable ( )
static

Definition at line 472 of file WikiPageTest.php.

References array(), and CONTENT_MODEL_WIKITEXT.

◆ providePreSaveTransform()

static WikiPageTest::providePreSaveTransform ( )
static

Definition at line 1087 of file WikiPageTest.php.

◆ setUp()

WikiPageTest::setUp ( )
protected

Reimplemented from MediaWikiLangTestCase.

Reimplemented in WikiPageTest_ContentHandlerUseDB.

Definition at line 35 of file WikiPageTest.php.

References array(), etc, redirect, and LinkCache\singleton().

◆ tearDown()

WikiPageTest::tearDown ( )
protected

Reimplemented from MediaWikiTestCase.

Definition at line 42 of file WikiPageTest.php.

References as.

◆ testDoDeleteArticle()

WikiPageTest::testDoDeleteArticle ( )

◆ testDoDeleteUpdates()

WikiPageTest::testDoDeleteUpdates ( )

◆ testDoEdit()

WikiPageTest::testDoEdit ( )

◆ testDoEditContent()

WikiPageTest::testDoEditContent ( )

◆ testDoQuickEdit()

WikiPageTest::testDoQuickEdit ( )

◆ testDoQuickEditContent()

WikiPageTest::testDoQuickEditContent ( )

◆ testDoRollback()

WikiPageTest::testDoRollback ( )
Todo:
FIXME: the above rollback test is better, but it keeps failing in jenkins for some reason.

@covers WikiPage::doRollback

Definition at line 855 of file WikiPageTest.php.

◆ testDoRollbackFailureSameContent()

WikiPageTest::testDoRollbackFailureSameContent ( )

@covers WikiPage::doRollback

Definition at line 890 of file WikiPageTest.php.

◆ testExists()

WikiPageTest::testExists ( )

◆ testGetAutoDeleteReason()

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

@dataProvider provideGetAutoDeleteReason @covers WikiPage::getAutoDeleteReason

Definition at line 1048 of file WikiPageTest.php.

◆ testGetAutosummary()

WikiPageTest::testGetAutosummary (   $old,
  $new,
  $flags,
  $expected 
)

@dataProvider provideGetAutoSummary @covers WikiPage::getAutosummary

Definition at line 975 of file WikiPageTest.php.

◆ testGetContent()

WikiPageTest::testGetContent ( )

@covers WikiPage::getContent

Definition at line 310 of file WikiPageTest.php.

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

◆ testGetContentHandler()

WikiPageTest::testGetContentHandler ( )

@covers WikiPage::getContentHandler

Reimplemented in WikiPageTest_ContentHandlerUseDB.

Definition at line 378 of file WikiPageTest.php.

References CONTENT_MODEL_JAVASCRIPT, createPage(), and global.

◆ testGetContentModel()

WikiPageTest::testGetContentModel ( )

@covers WikiPage::getContentModel

Reimplemented in WikiPageTest_ContentHandlerUseDB.

Definition at line 362 of file WikiPageTest.php.

References CONTENT_MODEL_JAVASCRIPT, createPage(), and global.

◆ testGetParserOutput()

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

@dataProvider provideGetParserOutput @covers WikiPage::getParserOutput

Definition at line 620 of file WikiPageTest.php.

References createPage().

◆ testGetParserOutput_badrev()

WikiPageTest::testGetParserOutput_badrev ( )

@covers WikiPage::getParserOutput

Definition at line 653 of file WikiPageTest.php.

◆ testGetParserOutput_nonexisting()

WikiPageTest::testGetParserOutput_nonexisting ( )

@covers WikiPage::getParserOutput

Definition at line 638 of file WikiPageTest.php.

◆ testGetRawText()

WikiPageTest::testGetRawText ( )

◆ testGetRedirectTarget()

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

@dataProvider provideGetRedirectTarget @covers WikiPage::getRedirectTarget

Definition at line 451 of file WikiPageTest.php.

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

◆ testGetRevision()

WikiPageTest::testGetRevision ( )

@covers WikiPage::getRevision

Definition at line 292 of file WikiPageTest.php.

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

◆ testGetText()

WikiPageTest::testGetText ( )

◆ testHasViewableContent()

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

@dataProvider provideHasViewableContent @covers WikiPage::hasViewableContent

Definition at line 427 of file WikiPageTest.php.

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

◆ testIsCountable()

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

@dataProvider provideIsCountable @covers WikiPage::isCountable

Definition at line 583 of file WikiPageTest.php.

References $title, createPage(), ContentHandler\getDefaultModelFor(), global, Title\newFromText(), and MediaWikiTestCase\setMwGlobals().

◆ testIsRedirect()

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

@dataProvider provideGetRedirectTarget @covers WikiPage::isRedirect

Definition at line 467 of file WikiPageTest.php.

References $title, and createPage().

◆ testPreSaveTransform()

WikiPageTest::testPreSaveTransform (   $text,
  $expected 
)

@dataProvider providePreSaveTransform @covers WikiPage::preSaveTransform

Definition at line 1102 of file WikiPageTest.php.

◆ testReplaceSection()

WikiPageTest::testReplaceSection (   $title,
  $model,
  $text,
  $section,
  $with,
  $sectionTitle,
  $expected 
)

@dataProvider dataReplaceSection @covers WikiPage::replaceSection

Definition at line 730 of file WikiPageTest.php.

◆ testReplaceSectionContent()

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

@dataProvider dataReplaceSection @covers WikiPage::replaceSectionContent

Definition at line 744 of file WikiPageTest.php.

◆ testWikiPageFactory()

WikiPageTest::testWikiPageFactory ( )

@covers WikiPage::factory

Definition at line 1117 of file WikiPageTest.php.

Member Data Documentation

◆ $pages_to_delete

WikiPageTest::$pages_to_delete
protected

Definition at line 11 of file WikiPageTest.php.

◆ $sections

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

Definition at line 664 of file WikiPageTest.php.


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