MediaWiki  REL1_24
EditPageTest Class Reference

Editing More...

Inheritance diagram for EditPageTest:
Collaboration diagram for EditPageTest:

List of all members.

Public Member Functions

 testAutoMerge ($baseUser, $text, $adamsEdit, $bertasEdit, $expectedCode, $expectedText, $message=null)
 provideAutoMerge EditPage
 testCreatePage ($desc, $pageTitle, $user, $editText, $expectedCode, $expectedText, $ignoreBlank=false)
 provideCreatePages EditPage
 testExtractSectionTitle ($section, $title)
 provideExtractSectionTitle EditPage::extractSectionTitle
 testSectionEdit ($base, $section, $text, $summary, $expected)
 provideSectionEdit EditPage
 testUpdatePage ()

Static Public Member Functions

static provideAutoMerge ()
static provideCreatePages ()
static provideExtractSectionTitle ()
static provideSectionEdit ()

Protected Member Functions

 assertEdit ($title, $baseText, $user=null, array $edit, $expectedCode=null, $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)

Detailed Description

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.


Member Function Documentation

EditPageTest::assertEdit ( title,
baseText,
user = null,
array edit,
expectedCode = null,
expectedText = null,
message = null 
) [protected]

Performs an edit and checks the result.

Parameters:
string | Title$titleThe title of the page to edit
string | null$baseTextSome text to create the page with before attempting the edit.
User | string | null$userThe user to perform the edit as.
array$editAn 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$expectedCodeThe expected result code (EditPage::AS_XXX constants). Set to null to skip the check.
string | null$expectedTextThe text expected to be on the page after the edit. Set to null to skip the check.
string | null$messageAn optional message to show along with any error message.
Returns:
WikiPage The page that was just edited, useful for getting the edit's rev_id, etc.

Definition at line 95 of file EditPageTest.php.

References $article, $content, $GLOBALS, $result, $title, $user, assertEditedTextEquals(), WikiPage\factory(), forceRevisionDate(), ContentHandler\getContentText(), ContextSource\getContext(), 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.

Parameters:
string$expected
string$actual
string$msg

Definition at line 66 of file EditPageTest.php.

Referenced by assertEdit().

EditPageTest::forceRevisionDate ( WikiPage page,
timestamp 
) [protected]

Definition at line 23 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 
)
EditPageTest::testCreatePage ( desc,
pageTitle,
user,
editText,
expectedCode,
expectedText,
ignoreBlank = false 
)

provideCreatePages EditPage

Definition at line 249 of file EditPageTest.php.

References $user, array(), EditPage\AS_BLANK_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 343 of file EditPageTest.php.

References $section, $summary, array(), EditPage\AS_SUCCESS_UPDATE, and assertEdit().


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