|
MediaWiki
REL1_23
|
Editing More...


Public Member Functions | |
| testAutoMerge ($baseUser, $text, $adamsEdit, $bertasEdit, $expectedCode, $expectedText, $message=null) | |
| provideAutoMerge EditPage | |
| testCreatePage () | |
| testExtractSectionTitle ($section, $title) | |
| provideExtractSectionTitle EditPage::extractSectionTitle | |
| testSectionEdit ($base, $section, $text, $summary, $expected) | |
| provideSectionEdit EditPage | |
| 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. | |
| assertEditedTextEquals ($expected, $actual, $msg= '') | |
| User input text is passed to rtrim() by edit page. | |
| 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 91 of file EditPageTest.php.
References $GLOBALS, $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 = '' |
||
| ) | [protected] |
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 63 of file EditPageTest.php.
Referenced by assertEdit().
| EditPageTest::forceRevisionDate | ( | WikiPage $ | page, |
| $ | timestamp | ||
| ) | [protected] |
Definition at line 48 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 359 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 23 of file EditPageTest.php.
References array().
| static EditPageTest::provideSectionEdit | ( | ) | [static] |
Definition at line 290 of file EditPageTest.php.
References array().
| EditPageTest::testAutoMerge | ( | $ | baseUser, |
| $ | text, | ||
| $ | adamsEdit, | ||
| $ | bertasEdit, | ||
| $ | expectedCode, | ||
| $ | expectedText, | ||
| $ | message = null |
||
| ) |
provideAutoMerge EditPage
Definition at line 442 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 180 of file EditPageTest.php.
References array(), EditPage\AS_BLANK_ARTICLE, EditPage\AS_SUCCESS_NEW_ARTICLE, and assertEdit().
| EditPageTest::testExtractSectionTitle | ( | $ | section, |
| $ | title | ||
| ) |
provideExtractSectionTitle EditPage::extractSectionTitle
Definition at line 18 of file EditPageTest.php.
References $section, $title, and EditPage\extractSectionTitle().
| EditPageTest::testSectionEdit | ( | $ | base, |
| $ | section, | ||
| $ | text, | ||
| $ | summary, | ||
| $ | expected | ||
| ) |
provideSectionEdit EditPage
Definition at line 347 of file EditPageTest.php.
References $section, $summary, array(), EditPage\AS_SUCCESS_UPDATE, and assertEdit().
Definition at line 266 of file EditPageTest.php.
References array(), EditPage\AS_SUCCESS_UPDATE, assertEdit(), and forceRevisionDate().