MediaWiki  REL1_21
EditPageTest Class Reference

Editing More...

Inheritance diagram for EditPageTest:
Collaboration diagram for EditPageTest:

List of all members.

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)

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 = EditPage::AS_OK,
$  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. Defaults to EditPage::AS_OK.
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 90 of file EditPageTest.php.

References $page, $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 22 of file EditPageTest.php.

References array().

static EditPageTest::provideSectionEdit ( ) [static]

Definition at line 211 of file EditPageTest.php.

References array().

EditPageTest::testAutoMerge ( $  baseUser,
$  text,
$  adamsEdit,
$  bertasEdit,
$  expectedCode,
$  expectedText,
$  message = null 
)
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 267 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: