MediaWiki  1.23.12
EditPageTest.php
Go to the documentation of this file.
1 <?php
2 
13 
18  public function testExtractSectionTitle( $section, $title ) {
19  $extracted = EditPage::extractSectionTitle( $section );
20  $this->assertEquals( $title, $extracted );
21  }
22 
23  public static function provideExtractSectionTitle() {
24  return array(
25  array(
26  "== Test ==\n\nJust a test section.",
27  "Test"
28  ),
29  array(
30  "An initial section, no header.",
31  false
32  ),
33  array(
34  "An initial section with a fake heder (bug 32617)\n\n== Test == ??\nwtf",
35  false
36  ),
37  array(
38  "== Section ==\nfollowed by a fake == Non-section == ??\nnoooo",
39  "Section"
40  ),
41  array(
42  "== Section== \t\r\n followed by whitespace (bug 35051)",
43  'Section',
44  ),
45  );
46  }
47 
48  protected function forceRevisionDate( WikiPage $page, $timestamp ) {
49  $dbw = wfGetDB( DB_MASTER );
50 
51  $dbw->update( 'revision',
52  array( 'rev_timestamp' => $dbw->timestamp( $timestamp ) ),
53  array( 'rev_id' => $page->getLatest() ) );
54 
55  $page->clear();
56  }
57 
63  protected function assertEditedTextEquals( $expected, $actual, $msg = '' ) {
64  return $this->assertEquals( rtrim( $expected ), rtrim( $actual ), $msg );
65  }
66 
91  protected function assertEdit( $title, $baseText, $user = null, array $edit,
92  $expectedCode = EditPage::AS_OK, $expectedText = null, $message = null
93  ) {
94  if ( is_string( $title ) ) {
95  $ns = $this->getDefaultWikitextNS();
97  }
98 
99  if ( is_string( $user ) ) {
101 
102  if ( $user->getId() === 0 ) {
103  $user->addToDatabase();
104  }
105  }
106 
107  $page = WikiPage::factory( $title );
108 
109  if ( $baseText !== null ) {
110  $content = ContentHandler::makeContent( $baseText, $title );
111  $page->doEditContent( $content, "base text for test" );
112  $this->forceRevisionDate( $page, '20120101000000' );
113 
114  //sanity check
115  $page->clear();
116  $currentText = ContentHandler::getContentText( $page->getContent() );
117 
118  # EditPage rtrim() the user input, so we alter our expected text
119  # to reflect that.
120  $this->assertEditedTextEquals( $baseText, $currentText );
121  }
122 
123  if ( $user == null ) {
124  $user = $GLOBALS['wgUser'];
125  } else {
126  $this->setMwGlobals( 'wgUser', $user );
127  }
128 
129  if ( !isset( $edit['wpEditToken'] ) ) {
130  $edit['wpEditToken'] = $user->getEditToken();
131  }
132 
133  if ( !isset( $edit['wpEdittime'] ) ) {
134  $edit['wpEdittime'] = $page->exists() ? $page->getTimestamp() : '';
135  }
136 
137  if ( !isset( $edit['wpStarttime'] ) ) {
138  $edit['wpStarttime'] = wfTimestampNow();
139  }
140 
141  $req = new FauxRequest( $edit, true ); // session ??
142 
143  $ep = new EditPage( new Article( $title ) );
144  $ep->setContextTitle( $title );
145  $ep->importFormData( $req );
146 
147  $bot = isset( $edit['bot'] ) ? (bool)$edit['bot'] : false;
148 
149  // this is where the edit happens!
150  // Note: don't want to use EditPage::AttemptSave, because it messes with $wgOut
151  // and throws exceptions like PermissionsError
152  $status = $ep->internalAttemptSave( $result, $bot );
153 
154  if ( $expectedCode !== null ) {
155  // check edit code
156  $this->assertEquals( $expectedCode, $status->value,
157  "Expected result code mismatch. $message" );
158  }
159 
160  $page = WikiPage::factory( $title );
161 
162  if ( $expectedText !== null ) {
163  // check resulting page text
164  $content = $page->getContent();
165  $text = ContentHandler::getContentText( $content );
166 
167  # EditPage rtrim() the user input, so we alter our expected text
168  # to reflect that.
169  $this->assertEditedTextEquals( $expectedText, $text,
170  "Expected article text mismatch. $message" );
171  }
172 
173  return $page;
174  }
175 
180  public function testCreatePage() {
181  $this->assertEdit(
182  'EditPageTest_testCreatePage',
183  null,
184  null,
185  array(
186  'wpTextbox1' => "Hello World!",
187  ),
188  EditPage::AS_SUCCESS_NEW_ARTICLE,
189  "Hello World!",
190  "expected article being created"
191  )->doDeleteArticleReal( 'EditPageTest_testCreatePage' );
192 
193  $this->assertEdit(
194  'EditPageTest_testCreatePage',
195  null,
196  null,
197  array(
198  'wpTextbox1' => "",
199  ),
200  EditPage::AS_BLANK_ARTICLE,
201  null,
202  "expected article not being created if empty"
203  );
204 
205  $this->assertEdit(
206  'MediaWiki:January',
207  null,
208  'UTSysop',
209  array(
210  'wpTextbox1' => "Not January",
211  ),
212  EditPage::AS_SUCCESS_NEW_ARTICLE,
213  "Not January",
214  "expected MediaWiki: page being created"
215  )->doDeleteArticleReal( 'EditPageTest_testCreatePage' );
216 
217  $this->assertEdit(
218  'MediaWiki:EditPageTest_testCreatePage',
219  null,
220  'UTSysop',
221  array(
222  'wpTextbox1' => "",
223  ),
224  EditPage::AS_BLANK_ARTICLE,
225  null,
226  "expected not-registered MediaWiki: page not being created if empty"
227  );
228 
229  $this->assertEdit(
230  'MediaWiki:January',
231  null,
232  'UTSysop',
233  array(
234  'wpTextbox1' => "",
235  ),
236  EditPage::AS_SUCCESS_NEW_ARTICLE,
237  "",
238  "expected registered MediaWiki: page being created even if empty"
239  )->doDeleteArticleReal( 'EditPageTest_testCreatePage' );
240 
241  $this->assertEdit(
242  'MediaWiki:Ipb-default-expiry',
243  null,
244  'UTSysop',
245  array(
246  'wpTextbox1' => "",
247  ),
248  EditPage::AS_BLANK_ARTICLE,
249  "",
250  "expected registered MediaWiki: page whose default content is empty not being created if empty"
251  );
252 
253  $this->assertEdit(
254  'MediaWiki:January',
255  null,
256  'UTSysop',
257  array(
258  'wpTextbox1' => "January",
259  ),
260  EditPage::AS_BLANK_ARTICLE,
261  null,
262  "expected MediaWiki: page not being created if text equals default message"
263  );
264  }
265 
266  public function testUpdatePage() {
267  $text = "one";
268  $edit = array(
269  'wpTextbox1' => $text,
270  'wpSummary' => 'first update',
271  );
272 
273  $page = $this->assertEdit( 'EditPageTest_testUpdatePage', "zero", null, $edit,
274  EditPage::AS_SUCCESS_UPDATE, $text,
275  "expected successfull update with given text" );
276 
277  $this->forceRevisionDate( $page, '20120101000000' );
278 
279  $text = "two";
280  $edit = array(
281  'wpTextbox1' => $text,
282  'wpSummary' => 'second update',
283  );
284 
285  $this->assertEdit( 'EditPageTest_testUpdatePage', null, null, $edit,
286  EditPage::AS_SUCCESS_UPDATE, $text,
287  "expected successfull update with given text" );
288  }
289 
290  public static function provideSectionEdit() {
291  $text = 'Intro
292 
293 == one ==
294 first section.
295 
296 == two ==
297 second section.
298 ';
299 
300  $sectionOne = '== one ==
301 hello
302 ';
303 
304  $newSection = '== new section ==
305 
306 hello
307 ';
308 
309  $textWithNewSectionOne = preg_replace(
310  '/== one ==.*== two ==/ms',
311  "$sectionOne\n== two ==", $text
312  );
313 
314  $textWithNewSectionAdded = "$text\n$newSection";
315 
316  return array(
317  array( #0
318  $text,
319  '',
320  'hello',
321  'replace all',
322  'hello'
323  ),
324 
325  array( #1
326  $text,
327  '1',
328  $sectionOne,
329  'replace first section',
330  $textWithNewSectionOne,
331  ),
332 
333  array( #2
334  $text,
335  'new',
336  'hello',
337  'new section',
338  $textWithNewSectionAdded,
339  ),
340  );
341  }
342 
347  public function testSectionEdit( $base, $section, $text, $summary, $expected ) {
348  $edit = array(
349  'wpTextbox1' => $text,
350  'wpSummary' => $summary,
351  'wpSection' => $section,
352  );
353 
354  $this->assertEdit( 'EditPageTest_testSectionEdit', $base, null, $edit,
355  EditPage::AS_SUCCESS_UPDATE, $expected,
356  "expected successfull update of section" );
357  }
358 
359  public static function provideAutoMerge() {
360  $tests = array();
361 
362  $tests[] = array( #0: plain conflict
363  "Elmo", # base edit user
364  "one\n\ntwo\n\nthree\n",
365  array( #adam's edit
366  'wpStarttime' => 1,
367  'wpTextbox1' => "ONE\n\ntwo\n\nthree\n",
368  ),
369  array( #berta's edit
370  'wpStarttime' => 2,
371  'wpTextbox1' => "(one)\n\ntwo\n\nthree\n",
372  ),
373  EditPage::AS_CONFLICT_DETECTED, # expected code
374  "ONE\n\ntwo\n\nthree\n", # expected text
375  'expected edit conflict', # message
376  );
377 
378  $tests[] = array( #1: successful merge
379  "Elmo", # base edit user
380  "one\n\ntwo\n\nthree\n",
381  array( #adam's edit
382  'wpStarttime' => 1,
383  'wpTextbox1' => "ONE\n\ntwo\n\nthree\n",
384  ),
385  array( #berta's edit
386  'wpStarttime' => 2,
387  'wpTextbox1' => "one\n\ntwo\n\nTHREE\n",
388  ),
389  EditPage::AS_SUCCESS_UPDATE, # expected code
390  "ONE\n\ntwo\n\nTHREE\n", # expected text
391  'expected automatic merge', # message
392  );
393 
394  $text = "Intro\n\n";
395  $text .= "== first section ==\n\n";
396  $text .= "one\n\ntwo\n\nthree\n\n";
397  $text .= "== second section ==\n\n";
398  $text .= "four\n\nfive\n\nsix\n\n";
399 
400  // extract the first section.
401  $section = preg_replace( '/.*(== first section ==.*)== second section ==.*/sm', '$1', $text );
402 
403  // generate expected text after merge
404  $expected = str_replace( 'one', 'ONE', str_replace( 'three', 'THREE', $text ) );
405 
406  $tests[] = array( #2: merge in section
407  "Elmo", # base edit user
408  $text,
409  array( #adam's edit
410  'wpStarttime' => 1,
411  'wpTextbox1' => str_replace( 'one', 'ONE', $section ),
412  'wpSection' => '1'
413  ),
414  array( #berta's edit
415  'wpStarttime' => 2,
416  'wpTextbox1' => str_replace( 'three', 'THREE', $section ),
417  'wpSection' => '1'
418  ),
419  EditPage::AS_SUCCESS_UPDATE, # expected code
420  $expected, # expected text
421  'expected automatic section merge', # message
422  );
423 
424  // see whether it makes a difference who did the base edit
425  $testsWithAdam = array_map( function ( $test ) {
426  $test[0] = 'Adam'; // change base edit user
427  return $test;
428  }, $tests );
429 
430  $testsWithBerta = array_map( function ( $test ) {
431  $test[0] = 'Berta'; // change base edit user
432  return $test;
433  }, $tests );
434 
435  return array_merge( $tests, $testsWithAdam, $testsWithBerta );
436  }
437 
442  public function testAutoMerge( $baseUser, $text, $adamsEdit, $bertasEdit,
443  $expectedCode, $expectedText, $message = null
444  ) {
445  $this->checkHasDiff3();
446 
447  //create page
448  $ns = $this->getDefaultWikitextNS();
449  $title = Title::newFromText( 'EditPageTest_testAutoMerge', $ns );
450  $page = WikiPage::factory( $title );
451 
452  if ( $page->exists() ) {
453  $page->doDeleteArticle( "clean slate for testing" );
454  }
455 
456  $baseEdit = array(
457  'wpTextbox1' => $text,
458  );
459 
460  $page = $this->assertEdit( 'EditPageTest_testAutoMerge', null,
461  $baseUser, $baseEdit, null, null, __METHOD__ );
462 
463  $this->forceRevisionDate( $page, '20120101000000' );
464 
465  $edittime = $page->getTimestamp();
466 
467  // start timestamps for conflict detection
468  if ( !isset( $adamsEdit['wpStarttime'] ) ) {
469  $adamsEdit['wpStarttime'] = 1;
470  }
471 
472  if ( !isset( $bertasEdit['wpStarttime'] ) ) {
473  $bertasEdit['wpStarttime'] = 2;
474  }
475 
477  $adamsTime = wfTimestamp( TS_MW, (int)wfTimestamp( TS_UNIX, $starttime ) + (int)$adamsEdit['wpStarttime'] );
478  $bertasTime = wfTimestamp( TS_MW, (int)wfTimestamp( TS_UNIX, $starttime ) + (int)$bertasEdit['wpStarttime'] );
479 
480  $adamsEdit['wpStarttime'] = $adamsTime;
481  $bertasEdit['wpStarttime'] = $bertasTime;
482 
483  $adamsEdit['wpSummary'] = 'Adam\'s edit';
484  $bertasEdit['wpSummary'] = 'Bertas\'s edit';
485 
486  $adamsEdit['wpEdittime'] = $edittime;
487  $bertasEdit['wpEdittime'] = $edittime;
488 
489  // first edit
490  $this->assertEdit( 'EditPageTest_testAutoMerge', null, 'Adam', $adamsEdit,
491  EditPage::AS_SUCCESS_UPDATE, null, "expected successfull update" );
492 
493  // second edit
494  $this->assertEdit( 'EditPageTest_testAutoMerge', null, 'Berta', $bertasEdit,
495  $expectedCode, $expectedText, $message );
496  }
497 }
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. $title:Title object for the current page $request:WebRequest $ignoreRedirect:boolean to skip redirect check $target:Title/string of redirect target $article:Article object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) $article:article(object) being checked 'IsTrustedProxy':Override the result of wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetMagic':DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetSpecialPageAliases':DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LinkBegin':Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1528
FauxRequest
WebRequest clone which takes values from a provided array.
Definition: WebRequest.php:1275
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:189
DB_MASTER
const DB_MASTER
Definition: Defines.php:56
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
EditPageTest\provideAutoMerge
static provideAutoMerge()
Definition: EditPageTest.php:359
EditPageTest\testExtractSectionTitle
testExtractSectionTitle( $section, $title)
@dataProvider provideExtractSectionTitle @covers EditPage::extractSectionTitle
Definition: EditPageTest.php:18
wfGetDB
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:3706
text
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
Definition: design.txt:12
$timestamp
if( $limit) $timestamp
Definition: importImages.php:104
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:2530
WikiPage
Class representing a MediaWiki article and history.
Definition: WikiPage.php:37
EditPageTest\provideExtractSectionTitle
static provideExtractSectionTitle()
Definition: EditPageTest.php:23
User\newFromName
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition: User.php:389
MediaWikiTestCase\checkHasDiff3
checkHasDiff3()
Check, if $wgDiff3 is set and ready to merge Will mark the calling test as skipped,...
Definition: MediaWikiTestCase.php:959
$test
$test
Definition: Utf8Test.php:89
WikiPage\factory
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
Definition: WikiPage.php:103
$starttime
$starttime
Definition: api.php:46
MediaWikiTestCase\setMwGlobals
setMwGlobals( $pairs, $value=null)
Definition: MediaWikiTestCase.php:302
EditPageTest\provideSectionEdit
static provideSectionEdit()
Definition: EditPageTest.php:290
EditPageTest\testCreatePage
testCreatePage()
Definition: EditPageTest.php:180
EditPageTest\forceRevisionDate
forceRevisionDate(WikiPage $page, $timestamp)
Definition: EditPageTest.php:48
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
MediaWikiTestCase\getDefaultWikitextNS
getDefaultWikitextNS()
Returns the ID of a namespace that defaults to Wikitext.
Definition: MediaWikiTestCase.php:903
wfTimestampNow
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
Definition: GlobalFunctions.php:2561
WikiPage\getLatest
getLatest()
Get the page_latest field.
Definition: WikiPage.php:556
ContentHandler\makeContent
static makeContent( $text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
Definition: ContentHandler.php:144
$section
$section
Definition: Utf8Test.php:88
TS_MW
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
Definition: GlobalFunctions.php:2478
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
user
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same user
Definition: distributors.txt:9
EditPageTest\testAutoMerge
testAutoMerge( $baseUser, $text, $adamsEdit, $bertasEdit, $expectedCode, $expectedText, $message=null)
@dataProvider provideAutoMerge @covers EditPage
Definition: EditPageTest.php:442
MediaWikiLangTestCase
Base class that store and restore the Language objects.
Definition: MediaWikiLangTestCase.php:6
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:237
$summary
$summary
Definition: importImages.php:120
EditPageTest\assertEdit
assertEdit( $title, $baseText, $user=null, array $edit, $expectedCode=EditPage::AS_OK, $expectedText=null, $message=null)
Performs an edit and checks the result.
Definition: EditPageTest.php:91
ContentHandler\getContentText
static getContentText(Content $content=null)
Convenience function for getting flat text from a Content object.
Definition: ContentHandler.php:94
EditPageTest
@group Editing
Definition: EditPageTest.php:12
in
Prior to maintenance scripts were a hodgepodge of code that had no cohesion or formal method of action Beginning in
Definition: maintenance.txt:1
TS_UNIX
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
Definition: GlobalFunctions.php:2473
EditPageTest\testUpdatePage
testUpdatePage()
Definition: EditPageTest.php:266
Article
Class for viewing MediaWiki article and history.
Definition: Article.php:36
EditPageTest\assertEditedTextEquals
assertEditedTextEquals( $expected, $actual, $msg='')
User input text is passed to rtrim() by edit page.
Definition: EditPageTest.php:63
code
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of or an object and a method hook function The function part of a third party developers and administrators to define code that will be run at certain points in the mainline code
Definition: hooks.txt:23
message
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a message
Definition: hooks.txt:1624
section
section
Definition: parserTests.txt:378
$GLOBALS
$GLOBALS['IP']
Definition: ComposerHookHandler.php:6
WikiPage\clear
clear()
Clear the object.
Definition: WikiPage.php:229
EditPageTest\testSectionEdit
testSectionEdit( $base, $section, $text, $summary, $expected)
@dataProvider provideSectionEdit @covers EditPage
Definition: EditPageTest.php:347