MediaWiki
1.23.2
|
Test class for Revision storage. More...
Static Public Member Functions | |
static | provideUserWasLastToEdit () |
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... | |
Public Attributes | |
WikiPage | $the_page |
$the_page More... | |
Public Attributes inherited from MediaWikiTestCase | |
const | DB_PREFIX = 'unittest_' |
Table name prefixes. More... | |
const | ORA_DB_PREFIX = 'ut_' |
Protected Member Functions | |
assertRevEquals (Revision $orig, Revision $rev=null) | |
createPage ( $page, $text, $model=null) | |
makeRevision ( $props=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... | |
Additional Inherited Members | |
Static Public Attributes inherited from MediaWikiTestCase | |
static | $users |
Static Protected Member Functions inherited from MediaWikiTestCase | |
static | stripStringKeys (&$r) |
Utility function for eliminating all string keys from an array. More... | |
Protected Attributes inherited from MediaWikiTestCase | |
DatabaseBase | $db |
array | $supportedDBs |
array | $tablesUsed = array() |
Test class for Revision storage.
@group ContentHandler @group Database ^— important, causes temporary tables to be used instead of the real database
@group medium ^— important, causes tests not to fail with timeout
Definition at line 13 of file RevisionStorageTest.php.
Reimplemented from MediaWikiTestCase.
Definition at line 19 of file RevisionStorageTest.php.
Definition at line 124 of file RevisionStorageTest.php.
References $rev, Revision\getContentFormat(), Revision\getContentModel(), Revision\getId(), Revision\getPage(), Revision\getSha1(), Revision\getTimestamp(), and Revision\getUser().
Referenced by testConstructFromRow(), testNewFromArchiveRow(), testNewFromId(), and testNewFromRow().
|
protected |
Definition at line 98 of file RevisionStorageTest.php.
References CONTENT_MODEL_WIKITEXT, EDIT_NEW, MWNamespace\getCanonicalName(), MediaWikiTestCase\getDefaultWikitextNS(), ContentHandler\makeContent(), and Title\newFromText().
Referenced by setUp(), testFetchRevision(), testGetNext(), testGetPrevious(), testIsCurrent(), testNewFromArchiveRow(), and testNewNullRevision().
|
protected |
Definition at line 73 of file RevisionStorageTest.php.
References $rev, array(), and DB_MASTER.
Referenced by testConstructFromRow(), testGetContent(), RevisionTest_ContentHandlerUseDB\testGetContentFormat(), testGetContentFormat(), RevisionTest_ContentHandlerUseDB\testGetContentModel(), testGetContentModel(), testGetPage(), testGetRawText(), testGetText(), testNewFromId(), and testNewFromRow().
|
static |
|
protected |
Reimplemented from MediaWikiTestCase.
Reimplemented in RevisionTest_ContentHandlerUseDB.
Definition at line 40 of file RevisionStorageTest.php.
References $wgContLang, cache, CONTENT_MODEL_WIKITEXT, createPage(), MWNamespace\getCanonicalNamespaces(), global, and if.
|
protected |
Reimplemented from MediaWikiTestCase.
Definition at line 58 of file RevisionStorageTest.php.
References $wgContLang, cache, MWNamespace\getCanonicalNamespaces(), and global.
RevisionStorageTest::testConstructFromRow | ( | ) |
@covers Revision::__construct
Definition at line 139 of file RevisionStorageTest.php.
References $dbr, $res, $rev, array(), assertRevEquals(), DB_SLAVE, and makeRevision().
RevisionStorageTest::testFetchRevision | ( | ) |
@covers Revision::fetchRevision
Definition at line 206 of file RevisionStorageTest.php.
References $res, array(), CONTENT_MODEL_WIKITEXT, createPage(), and Revision\fetchRevision().
RevisionStorageTest::testGetContent | ( | ) |
@covers Revision::getContent
Definition at line 293 of file RevisionStorageTest.php.
References $rev, array(), makeRevision(), and Revision\newFromId().
RevisionStorageTest::testGetContent_failure | ( | ) |
@covers Revision::getContent
Definition at line 275 of file RevisionStorageTest.php.
RevisionStorageTest::testGetContentFormat | ( | ) |
@covers Revision::getContentFormat
Reimplemented in RevisionTest_ContentHandlerUseDB.
Definition at line 332 of file RevisionStorageTest.php.
References $rev, array(), CONTENT_FORMAT_JAVASCRIPT, CONTENT_MODEL_JAVASCRIPT, global, makeRevision(), and Revision\newFromId().
RevisionStorageTest::testGetContentModel | ( | ) |
@covers Revision::getContentModel
Reimplemented in RevisionTest_ContentHandlerUseDB.
Definition at line 315 of file RevisionStorageTest.php.
References $rev, array(), CONTENT_MODEL_JAVASCRIPT, global, makeRevision(), and Revision\newFromId().
RevisionStorageTest::testGetNext | ( | ) |
@covers Revision::getNext
Definition at line 395 of file RevisionStorageTest.php.
References CONTENT_MODEL_WIKITEXT, createPage(), and ContentHandler\makeContent().
RevisionStorageTest::testGetPage | ( | ) |
@covers Revision::getPage
Definition at line 251 of file RevisionStorageTest.php.
References $rev, $the_page, array(), makeRevision(), and Revision\newFromId().
RevisionStorageTest::testGetPrevious | ( | ) |
@covers Revision::getPrevious
Definition at line 378 of file RevisionStorageTest.php.
References CONTENT_MODEL_WIKITEXT, createPage(), and ContentHandler\makeContent().
RevisionStorageTest::testGetRawText | ( | ) |
@covers Revision::getRawText
Definition at line 303 of file RevisionStorageTest.php.
References $rev, array(), MediaWikiTestCase\hideDeprecated(), makeRevision(), and Revision\newFromId().
RevisionStorageTest::testGetText | ( | ) |
@covers Revision::getText
Definition at line 263 of file RevisionStorageTest.php.
References $rev, array(), MediaWikiTestCase\hideDeprecated(), makeRevision(), and Revision\newFromId().
RevisionStorageTest::testIsCurrent | ( | ) |
@covers Revision::isCurrent
Definition at line 352 of file RevisionStorageTest.php.
References CONTENT_MODEL_WIKITEXT, createPage(), ContentHandler\makeContent(), and Revision\newFromId().
RevisionStorageTest::testNewFromArchiveRow | ( | ) |
@covers Revision::newFromArchiveRow
Definition at line 175 of file RevisionStorageTest.php.
References $dbr, $res, $rev, array(), assertRevEquals(), CONTENT_MODEL_WIKITEXT, createPage(), DB_SLAVE, and Revision\newFromArchiveRow().
RevisionStorageTest::testNewFromId | ( | ) |
@covers Revision::newFromId
Definition at line 195 of file RevisionStorageTest.php.
References $rev, assertRevEquals(), makeRevision(), and Revision\newFromId().
RevisionStorageTest::testNewFromRow | ( | ) |
@covers Revision::newFromRow
Definition at line 157 of file RevisionStorageTest.php.
References $dbr, $res, $rev, array(), assertRevEquals(), DB_SLAVE, makeRevision(), and Revision\newFromRow().
RevisionStorageTest::testNewNullRevision | ( | ) |
@covers Revision::newNullRevision
Definition at line 412 of file RevisionStorageTest.php.
References $rev, CONTENT_MODEL_WIKITEXT, createPage(), DB_MASTER, false, Revision\newNullRevision(), and wfGetDB().
RevisionStorageTest::testSelectFields | ( | ) |
@covers Revision::selectFields
Reimplemented in RevisionTest_ContentHandlerUseDB.
Definition at line 230 of file RevisionStorageTest.php.
References global, and Revision\selectFields().
RevisionStorageTest::testUserWasLastToEdit | ( | $sinceIdx, | |
$expectedLast | |||
) |
@dataProvider provideUserWasLastToEdit
Definition at line 446 of file RevisionStorageTest.php.
References array(), CONTENT_MODEL_WIKITEXT, User\createNew(), DB_MASTER, WikiPage\factory(), MediaWikiTestCase\getDefaultWikitextNS(), User\newFromName(), Title\newFromText(), Revision\userWasLastToEdit(), and wfGetDB().
WikiPage RevisionStorageTest::$the_page |