MediaWiki
REL1_22
|
Editing More...
Public Member Functions | |
assertEditedTextEquals ($expected, $actual, $msg= '') | |
User input text is passed to rtrim() by edit page. | |
testAutoMerge ($baseUser, $text, $adamsEdit, $bertasEdit, $expectedCode, $expectedText, $message=null) | |
provideAutoMerge | |
testCreatePage () | |
testExtractSectionTitle ($section, $title) | |
provideExtractSectionTitle | |
testSectionEdit ($base, $section, $text, $summary, $expected) | |
provideSectionEdit | |
testUpdatePage () | |
Static Public Member Functions | |
static | provideAutoMerge () |
static | provideExtractSectionTitle () |
static | provideSectionEdit () |
Protected Member Functions | |
assertEdit ($title, $baseText, $user=null, array $edit, $expectedCode=EditPage::AS_OK, $expectedText=null, $message=null) | |
Performs an edit and checks the result. | |
forceRevisionDate (WikiPage $page, $timestamp) |
Editing
Database ^--- tell jenkins this test needs the database
medium ^--- tell phpunit that these test cases may take longer than 2 seconds.
Definition at line 12 of file EditPageTest.php.
EditPageTest::assertEdit | ( | $ | title, |
$ | baseText, | ||
$ | user = null , |
||
array $ | edit, | ||
$ | expectedCode = EditPage::AS_OK , |
||
$ | expectedText = null , |
||
$ | message = null |
||
) | [protected] |
Performs an edit and checks the result.
String | Title | $title | The title of the page to edit |
String | null | $baseText | Some text to create the page with before attempting the edit. |
User | String | null | $user | The user to perform the edit as. |
array | $edit | An array of request parameters used to define the edit to perform. Some well known fields are: * wpTextbox1: the text to submit * wpSummary: the edit summary * wpEditToken: the edit token (will be inserted if not provided) * wpEdittime: timestamp of the edit's base revision (will be inserted if not provided) * wpStarttime: timestamp when the edit started (will be inserted if not provided) * wpSectionTitle: the section to edit * wpMinorEdit: mark as minor edit * wpWatchthis: whether to watch the page |
int | null | $expectedCode | The expected result code (EditPage::AS_XXX constants). Set to null to skip the check. Defaults to EditPage::AS_OK. |
String | null | $expectedText | The text expected to be on the page after the edit. Set to null to skip the check. |
String | null | $message | An optional message to show along with any error message. |
Definition at line 90 of file EditPageTest.php.
References $result, $title, $user, assertEditedTextEquals(), WikiPage\factory(), forceRevisionDate(), ContentHandler\getContentText(), MediaWikiTestCase\getDefaultWikitextNS(), ContentHandler\makeContent(), User\newFromName(), Title\newFromText(), MediaWikiTestCase\setMwGlobals(), and wfTimestampNow().
Referenced by testAutoMerge(), testCreatePage(), testSectionEdit(), and testUpdatePage().
EditPageTest::assertEditedTextEquals | ( | $ | expected, |
$ | actual, | ||
$ | msg = '' |
||
) |
User input text is passed to rtrim() by edit page.
This is a simple wrapper around assertEquals() which calls rrtrim() to normalize the expected and actual texts.
Definition at line 62 of file EditPageTest.php.
Referenced by assertEdit().
EditPageTest::forceRevisionDate | ( | WikiPage $ | page, |
$ | timestamp | ||
) | [protected] |
Definition at line 47 of file EditPageTest.php.
References $timestamp, array(), WikiPage\clear(), WikiPage\getLatest(), and wfGetDB().
Referenced by assertEdit(), testAutoMerge(), and testUpdatePage().
static EditPageTest::provideAutoMerge | ( | ) | [static] |
Definition at line 354 of file EditPageTest.php.
References $section, $test, array(), EditPage\AS_CONFLICT_DETECTED, EditPage\AS_SUCCESS_UPDATE, code, in, message, section, text, and user.
static EditPageTest::provideExtractSectionTitle | ( | ) | [static] |
Definition at line 22 of file EditPageTest.php.
References array().
static EditPageTest::provideSectionEdit | ( | ) | [static] |
Definition at line 286 of file EditPageTest.php.
References array().
EditPageTest::testAutoMerge | ( | $ | baseUser, |
$ | text, | ||
$ | adamsEdit, | ||
$ | bertasEdit, | ||
$ | expectedCode, | ||
$ | expectedText, | ||
$ | message = null |
||
) |
provideAutoMerge
Definition at line 436 of file EditPageTest.php.
References $starttime, $title, array(), EditPage\AS_SUCCESS_UPDATE, assertEdit(), MediaWikiTestCase\checkHasDiff3(), WikiPage\factory(), forceRevisionDate(), MediaWikiTestCase\getDefaultWikitextNS(), Title\newFromText(), wfTimestamp(), and wfTimestampNow().
Definition at line 175 of file EditPageTest.php.
References array(), EditPage\AS_BLANK_ARTICLE, EditPage\AS_SUCCESS_NEW_ARTICLE, and assertEdit().
EditPageTest::testExtractSectionTitle | ( | $ | section, |
$ | title | ||
) |
provideExtractSectionTitle
Definition at line 17 of file EditPageTest.php.
References $section, $title, and EditPage\extractSectionTitle().
EditPageTest::testSectionEdit | ( | $ | base, |
$ | section, | ||
$ | text, | ||
$ | summary, | ||
$ | expected | ||
) |
provideSectionEdit
Definition at line 342 of file EditPageTest.php.
References $section, $summary, array(), EditPage\AS_SUCCESS_UPDATE, and assertEdit().
Definition at line 262 of file EditPageTest.php.
References array(), EditPage\AS_SUCCESS_UPDATE, assertEdit(), and forceRevisionDate().