20 'wgExtraNamespaces' => [
22 12313 =>
'Dummy_talk',
23 12314 =>
'DummyNonText',
24 12315 =>
'DummyNonText_talk',
26 'wgNamespaceContentModels' => [
28 12314 =>
'testing-nontext',
32 'testing' =>
'DummyContentHandlerForTesting',
33 'testing-nontext' =>
'DummyNonTextContentHandler',
34 'testing-serialize-error' =>
'DummySerializeErrorContentHandler',
36 $this->tablesUsed = array_merge(
38 [
'change_tag',
'change_tag_def',
'logging' ]
43 $name =
'Help:ApiEditPageTest_testEdit';
49 'text' =>
'some text',
51 $apiResult = $apiResult[0];
54 $this->assertArrayHasKey(
'edit', $apiResult );
55 $this->assertArrayHasKey(
'result', $apiResult[
'edit'] );
56 $this->assertSame(
'Success', $apiResult[
'edit'][
'result'] );
58 $this->assertArrayHasKey(
'new', $apiResult[
'edit'] );
59 $this->assertArrayNotHasKey(
'nochange', $apiResult[
'edit'] );
61 $this->assertArrayHasKey(
'pageid', $apiResult[
'edit'] );
67 'text' =>
'some text',
70 $this->assertSame(
'Success',
$data[0][
'edit'][
'result'] );
72 $this->assertArrayNotHasKey(
'new',
$data[0][
'edit'] );
73 $this->assertArrayHasKey(
'nochange',
$data[0][
'edit'] );
79 'text' =>
'different text'
82 $this->assertSame(
'Success',
$data[0][
'edit'][
'result'] );
84 $this->assertArrayNotHasKey(
'new',
$data[0][
'edit'] );
85 $this->assertArrayNotHasKey(
'nochange',
$data[0][
'edit'] );
87 $this->assertArrayHasKey(
'oldrevid',
$data[0][
'edit'] );
88 $this->assertArrayHasKey(
'newrevid',
$data[0][
'edit'] );
89 $this->assertNotEquals(
90 $data[0][
'edit'][
'newrevid'],
91 $data[0][
'edit'][
'oldrevid'],
92 "revision id should change after edit"
102 'foo',
'append',
'bar',
"foobar"
105 'foo',
'prepend',
'bar',
"barfoo"
107 [ # 2: append to empty
page
108 '',
'append',
'foo',
"foo"
110 [ # 3: prepend to empty
page
111 '',
'prepend',
'foo',
"foo"
113 [ # 4: append to non-existing
page
114 null,
'append',
'foo',
"foo"
116 [ # 5: prepend to non-existing
page
117 null,
'prepend',
'foo',
"foo"
130 $name =
"Help:ApiEditPageTest_testEditAppend_$count";
133 if ( $text !==
null ) {
137 'text' => $text, ] );
139 $this->assertSame(
'Success', $re[
'edit'][
'result'] );
146 $op .
'text' => $append, ] );
148 $this->assertSame(
'Success', $re[
'edit'][
'result'] );
153 $this->assertNotNull(
$content,
'Page should have been created' );
157 $this->assertSame( $expected, $text );
164 $name =
'Help:ApiEditPageTest_testEditSection';
166 $text =
"==section 1==\ncontent 1\n==section 2==\ncontent2";
174 'text' =>
"==section 1==\nnew content 1",
176 $this->assertSame(
'Success', $re[
'edit'][
'result'] );
180 $this->assertSame(
"==section 1==\nnew content 1\n\n==section 2==\ncontent2", $newtext );
190 $this->fail(
"Should have raised an ApiUsageException" );
192 $this->assertTrue( self::apiExceptionHasCode(
$e,
'nosuchsection' ) );
203 $name =
'Help:ApiEditPageTest_testEditNewSection';
212 'summary' =>
'header',
215 $this->assertSame(
'Success', $re[
'edit'][
'result'] );
220 $this->assertSame(
"== header ==\n\ntest", $text );
229 'summary' =>
'header',
232 $this->assertSame(
'Success', $re2[
'edit'][
'result'] );
236 $this->assertSame(
"== header ==\n\ntest\n\n== header ==\n\ntest", $text );
247 $name =
"Help:ApiEditPageTest_testEdit_redirect_$count";
251 $rname =
"Help:ApiEditPageTest_testEdit_redirect_r$count";
257 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
259 $baseTime = $page->getRevision()->getTimestamp();
263 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
267 $rpage->doEditContent(
new WikitextContent(
"#REDIRECT [[$name]]\n\n[[Category:Test]]" ),
268 "testing 2",
EDIT_UPDATE, $page->getLatest(), self::$users[
'uploader']->getUser() );
275 'text' =>
'nix bar!',
276 'basetimestamp' => $baseTime,
281 $this->assertSame(
'Success', $re[
'edit'][
'result'],
282 "no problems expected when following redirect" );
293 $name =
"Help:ApiEditPageTest_testEdit_redirectText_$count";
297 $rname =
"Help:ApiEditPageTest_testEdit_redirectText_r$count";
303 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
305 $baseTime = $page->getRevision()->getTimestamp();
309 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
313 $rpage->doEditContent(
new WikitextContent(
"#REDIRECT [[$name]]\n\n[[Category:Test]]" ),
314 "testing 2",
EDIT_UPDATE, $page->getLatest(), self::$users[
'uploader']->getUser() );
322 'text' =>
'nix bar!',
323 'basetimestamp' => $baseTime,
327 $this->fail(
'redirect-appendonly error expected' );
329 $this->assertTrue( self::apiExceptionHasCode( $ex,
'redirect-appendonly' ) );
338 $name =
"Help:ApiEditPageTest_testEditConflict_$count";
345 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
347 $baseTime = $page->getRevision()->getTimestamp();
351 "testing 2",
EDIT_UPDATE, $page->getLatest(), self::$users[
'uploader']->getUser() );
359 'text' =>
'nix bar!',
360 'basetimestamp' => $baseTime,
363 $this->fail(
'edit conflict expected' );
365 $this->assertTrue( self::apiExceptionHasCode( $ex,
'editconflict' ) );
377 $name =
"Help:ApiEditPageTest_testEditConflict_newSection_$count";
384 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
386 $baseTime = $page->getRevision()->getTimestamp();
390 "testing 2",
EDIT_UPDATE, $page->getLatest(), self::$users[
'uploader']->getUser() );
397 'text' =>
'nix bar!',
398 'basetimestamp' => $baseTime,
402 $this->assertSame(
'Success', $re[
'edit'][
'result'],
403 "no edit conflict expected here" );
417 $name =
"Help:ApiEditPageTest_testEditConflict_redirect_T43990_$count";
421 $rname =
"Help:ApiEditPageTest_testEditConflict_redirect_T43990_r$count";
427 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
432 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
437 "testing 2",
EDIT_UPDATE, $page->getLatest(), self::$users[
'uploader']->getUser() );
444 'text' =>
'nix bar!',
449 $this->assertSame(
'Success', $re[
'edit'][
'result'],
450 "no edit conflict expected here" );
460 $dbw->update(
'revision',
461 [
'rev_timestamp' => $dbw->timestamp( $timestamp ) ],
468 $this->setExpectedException(
470 'Direct editing via API is not supported for content model ' .
471 'testing used by Dummy:ApiEditPageTest_nonTextPageEdit'
476 'title' =>
'Dummy:ApiEditPageTest_nonTextPageEdit',
477 'text' =>
'{"animals":["kittens!"]}'
482 $name =
'DummyNonText:ApiEditPageTest_testNonTextEdit';
494 $this->assertArrayHasKey(
'edit', $apiResult );
495 $this->assertArrayHasKey(
'result', $apiResult[
'edit'] );
496 $this->assertSame(
'Success', $apiResult[
'edit'][
'result'] );
498 $this->assertArrayHasKey(
'new', $apiResult[
'edit'] );
499 $this->assertArrayNotHasKey(
'nochange', $apiResult[
'edit'] );
501 $this->assertArrayHasKey(
'pageid', $apiResult[
'edit'] );
505 $this->assertSame(
"testing-nontext", $page->getContentModel() );
506 $this->assertSame(
$data, $page->getContent()->serialize() );
515 $name =
'Help:' . __FUNCTION__;
516 $uploader = self::$users[
'uploader']->getUser();
517 $sysop = self::$users[
'sysop']->getUser();
522 'text' =>
'some text',
523 ],
null, $sysop )[0];
526 $this->assertArrayHasKey(
'edit', $apiResult );
527 $this->assertArrayHasKey(
'result', $apiResult[
'edit'] );
528 $this->assertSame(
'Success', $apiResult[
'edit'][
'result'] );
529 $this->assertArrayHasKey(
'contentmodel', $apiResult[
'edit'] );
531 $this->assertSame(
'wikitext', $apiResult[
'edit'][
'contentmodel'] );
538 'contentmodel' =>
'json',
539 ],
null, $uploader )[0];
542 $this->assertArrayHasKey(
'edit', $apiResult );
543 $this->assertArrayHasKey(
'result', $apiResult[
'edit'] );
544 $this->assertSame(
'Success', $apiResult[
'edit'][
'result'] );
545 $this->assertArrayHasKey(
'contentmodel', $apiResult[
'edit'] );
546 $this->assertSame(
'json', $apiResult[
'edit'][
'contentmodel'] );
551 'undo' => $apiResult[
'edit'][
'newrevid']
552 ],
null, $sysop )[0];
555 $this->assertArrayHasKey(
'edit', $apiResult );
556 $this->assertArrayHasKey(
'result', $apiResult[
'edit'] );
557 $this->assertSame(
'Success', $apiResult[
'edit'][
'result'] );
558 $this->assertArrayHasKey(
'contentmodel', $apiResult[
'edit'] );
560 $this->assertSame(
'wikitext', $apiResult[
'edit'][
'contentmodel'] );
567 $name =
'Help:' . ucfirst( __FUNCTION__ );
572 'text' =>
'some text',
573 'contentmodel' =>
'wikitext',
574 'contentformat' =>
'text/x-wiki',
581 $name =
'Help:' . ucfirst( __FUNCTION__ );
584 'Unrecognized value for parameter "contentformat": nonexistent format.' );
590 'text' =>
'some text',
591 'contentformat' =>
'nonexistent format',
599 $name =
'Help:' . ucfirst( __FUNCTION__ );
602 'The requested format text/plain is not supported for content ' .
603 "model wikitext used by $name." );
609 'text' =>
'some text',
610 'contentmodel' =>
'wikitext',
611 'contentformat' =>
'text/plain',
619 $name =
'Help:' . ucfirst( __FUNCTION__ );
621 $revId = $this->
editPage(
$name,
'Some text' )->value[
'revision']
626 "There is no revision with ID $revId." );
649 $name =
'Help:' . ucfirst( __FUNCTION__ );
652 $revId1 = $this->
editPage(
$name,
'1' )->value[
'revision']->getId();
653 $revId2 = $this->
editPage(
$name,
'2' )->value[
'revision']->getId();
654 $revId3 = $this->
editPage(
$name,
'3' )->value[
'revision']->getId();
658 $dbw->delete(
'revision', [
'rev_id' => $revId2 ], __METHOD__ );
659 $dbw->update(
'revision', [
'rev_parent_id' => $revId1 ],
660 [
'rev_id' => $revId3 ], __METHOD__ );
663 "There is no revision with ID $revId2." );
669 'undoafter' => $revId2,
678 $name =
'Help:' . ucfirst( __FUNCTION__ );
683 $revId1 = $this->
editPage(
$name,
'1' )->value[
'revision']->getId();
685 $revId2 = $this->
editPage(
$name,
'2' )->value[
'revision']->getId();
690 $list->setVisibility( [
692 'comment' =>
'Bye-bye',
696 "There is no revision with ID $revId1." );
702 'undoafter' => $revId1,
711 $name =
'Help:' . ucfirst( __FUNCTION__ );
716 $revId2 = $this->
editPage(
$name,
'2' )->value[
'revision']->getId();
718 $revId1 = $this->
editPage(
$name,
'1' )->value[
'revision']->getId();
724 [
'rev_timestamp' => $dbw->timestamp( time() - 86400 ) ],
725 [
'rev_id' => $revId1 ],
733 'undoafter' => $revId1,
736 $text = (
new WikiPage( $titleObj ) )->getContent()->getText();
742 $this->assertSame(
'2', $text );
746 $name =
'Help:' . ucfirst( __FUNCTION__ );
749 'The edit could not be undone due to conflicting intermediate edits.' );
753 $revId = $this->
editPage(
$name,
'2' )->value[
'revision']->getId();
765 $this->assertSame(
'3', $text );
773 $name =
'Help:' . ucfirst( __FUNCTION__ );
776 $revId1 = $this->
editPage(
$name,
'1' )->value[
'revision']->getId();
777 $revId2 = $this->
editPage(
$name,
'2' )->value[
'revision']->getId();
783 'undoafter' => $revId2,
788 $this->assertSame(
'1', $text );
792 $name =
'Help:' . ucfirst( __FUNCTION__ );
794 $this->
editPage(
"$name-1",
'Some text' );
795 $revId = $this->
editPage(
"$name-1",
'Some more text' )
796 ->value[
'revision']->getId();
798 $this->
editPage(
"$name-2",
'Some text' );
801 "r$revId is not a revision of $name-2." );
805 'title' =>
"$name-2",
811 $name =
'Help:' . ucfirst( __FUNCTION__ );
813 $revId1 = $this->
editPage(
"$name-1",
'Some text' )
814 ->value[
'revision']->getId();
816 $revId2 = $this->
editPage(
"$name-2",
'Some text' )
817 ->value[
'revision']->getId();
820 "r$revId1 is not a revision of $name-2." );
824 'title' =>
"$name-2",
826 'undoafter' => $revId1,
831 $name =
'Help:' . ucfirst( __FUNCTION__ );
838 'text' =>
'Some text',
839 'md5' => md5(
'Some text' ),
846 $name =
'Help:' . ucfirst( __FUNCTION__ );
853 'prependtext' =>
'Alert: ',
854 'md5' => md5(
'Alert: ' ),
858 ->getContent()->getText();
859 $this->assertSame(
'Alert: Some text', $text );
863 $name =
'Help:' . ucfirst( __FUNCTION__ );
870 'appendtext' =>
' is nice',
871 'md5' => md5(
' is nice' ),
875 ->getContent()->getText();
876 $this->assertSame(
'Some text is nice', $text );
880 $name =
'Help:' . ucfirst( __FUNCTION__ );
887 'prependtext' =>
'Alert: ',
888 'appendtext' =>
' is nice',
889 'md5' => md5(
'Alert: is nice' ),
893 ->getContent()->getText();
894 $this->assertSame(
'Alert: Some text is nice', $text );
898 $name =
'Help:' . ucfirst( __FUNCTION__ );
901 'The supplied MD5 hash was incorrect.' );
906 'text' =>
'Some text',
912 $name =
'Help:' . ucfirst( __FUNCTION__ );
915 'The supplied MD5 hash was incorrect.' );
920 'prependtext' =>
'Some ',
921 'appendtext' =>
'text',
922 'md5' => md5(
'Some ' ),
927 $name =
'Help:' . ucfirst( __FUNCTION__ );
930 'The supplied MD5 hash was incorrect.' );
935 'prependtext' =>
'Some ',
936 'appendtext' =>
'text',
937 'md5' => md5(
'text' ),
942 $name =
'Help:' . ucfirst( __FUNCTION__ );
945 'The article you tried to create has been created already.' );
954 'text' =>
'Some more text',
960 ->getContent()->getText();
962 $this->assertSame(
'Some text', $text );
967 $name =
'Help:' . ucfirst( __FUNCTION__ );
970 "The page you specified doesn't exist." );
978 'text' =>
'Some text',
992 $name =
'MediaWiki:' . ucfirst( __FUNCTION__ );
995 "Can't append to pages using content model testing-nontext." );
1000 $model =
'testing-nontext';
1009 'appendtext' =>
'Some text',
1014 $name =
'MediaWiki:' . ucfirst( __FUNCTION__ );
1021 'appendtext' =>
'Some text',
1028 $name =
'MediaWiki:' . ucfirst( __FUNCTION__ );
1031 'Content serialization failed: Could not unserialize content' );
1036 $model =
'testing-serialize-error';
1045 'appendtext' =>
'Some text',
1050 $name =
'Help:' . ucfirst( __FUNCTION__ );
1057 'appendtext' =>
'== New section ==',
1062 ->getContent()->getText();
1064 $this->assertSame(
"Initial content\n\n== New section ==", $text );
1068 $name =
'Help:' . ucfirst( __FUNCTION__ );
1071 'Sections are not supported for content model text.' );
1078 'appendtext' =>
'== New section ==',
1080 'contentmodel' =>
'text',
1085 $name =
'Help:' . ucfirst( __FUNCTION__ );
1092 'sectiontitle' =>
'My section',
1093 'appendtext' =>
'More content',
1099 $this->assertSame(
"Initial content\n\n== My section ==\n\nMore content",
1100 $page->getContent()->getText() );
1101 $this->assertSame(
'/* My section */ new section',
1102 $page->getRevision()->getComment() );
1106 $name =
'Help:' . ucfirst( __FUNCTION__ );
1113 'appendtext' =>
'More content',
1115 'summary' =>
'Add new section',
1120 $this->assertSame(
"Initial content\n\n== Add new section ==\n\nMore content",
1121 $page->getContent()->getText() );
1123 $this->assertSame(
'/* Add new section */ new section',
1124 $page->getRevision()->getComment() );
1128 $name =
'Help:' . ucfirst( __FUNCTION__ );
1135 'sectiontitle' =>
'My section',
1136 'appendtext' =>
'More content',
1138 'summary' =>
'Add new section',
1143 $this->assertSame(
"Initial content\n\n== My section ==\n\nMore content",
1144 $page->getContent()->getText() );
1145 $this->assertSame(
'Add new section',
1146 $page->getRevision()->getComment() );
1150 $name =
'Help:' . ucfirst( __FUNCTION__ );
1153 "== Section 2 ==\n\nFascinating!" );
1158 'appendtext' =>
' and more content',
1163 ->getContent()->getText();
1165 $this->assertSame(
"== Section 1 ==\n\nContent and more content\n\n" .
1166 "== Section 2 ==\n\nFascinating!", $text );
1170 $name =
'Help:' . ucfirst( __FUNCTION__ );
1172 $this->
editPage(
$name,
"Content\n\n== Section 1 ==\n\nFascinating!" );
1177 'appendtext' =>
' and more content',
1182 ->getContent()->getText();
1184 $this->assertSame(
"Content and more content\n\n== Section 1 ==\n\n" .
1185 "Fascinating!", $text );
1189 $name =
'Help:' . ucfirst( __FUNCTION__ );
1199 'appendtext' =>
' and more content',
1204 ->getContent()->getText();
1206 $this->assertSame(
'Content', $text );
1211 $name =
'Help:' . ucfirst( __FUNCTION__ );
1214 'The "section" parameter must be a valid section ID or "new".' );
1221 'text' =>
'Different content',
1222 'section' =>
'It is unlikely that this is valid',
1226 ->getContent()->getText();
1228 $this->assertSame(
'Content', $text );
1233 $name =
'Help:' . ucfirst( __FUNCTION__ );
1235 'The page has been deleted since you fetched its timestamp.' );
1237 $startTime = MWTimestamp::convert( TS_MW, time() - 1 );
1242 $pageObj->doDeleteArticle(
'Bye-bye' );
1244 $this->assertFalse( $pageObj->exists() );
1250 'text' =>
'Different text',
1251 'starttimestamp' => $startTime,
1254 $this->assertFalse( $pageObj->exists() );
1259 $name =
'Help:' . ucfirst( __FUNCTION__ );
1266 'text' =>
'Different text',
1270 $revisionStore = \MediaWiki\MediaWikiServices::getInstance()->getRevisionStore();
1272 $this->assertTrue( $revision->isMinor() );
1276 $name =
'Help:' . ucfirst( __FUNCTION__ );
1278 $startTime = MWTimestamp::convert( TS_MW, time() - 1 );
1283 $pageObj->doDeleteArticle(
'Bye-bye' );
1285 $this->assertFalse( $pageObj->exists() );
1290 'text' =>
'Different text',
1291 'starttimestamp' => $startTime,
1299 $name =
'Help:' . ucfirst( __FUNCTION__ );
1300 $user = self::$users[
'sysop']->getUser();
1305 'text' =>
'Some text',
1314 $name =
'Help:' . ucfirst( __FUNCTION__ );
1315 $user = self::$users[
'sysop']->getUser();
1318 $user->addWatch( $titleObj );
1320 $this->assertFalse( $titleObj->exists() );
1321 $this->assertTrue(
$user->isWatched( $titleObj ) );
1326 'text' =>
'Some text',
1330 $this->assertTrue( $titleObj->exists() );
1331 $this->assertFalse(
$user->isWatched( $titleObj ) );
1335 $name =
'Help:' . ucfirst( __FUNCTION__ );
1342 'text' =>
'Some text',
1343 'tags' =>
'custom tag',
1344 ] )[0][
'edit'][
'newrevid'];
1347 $this->assertSame(
'custom tag', $dbw->selectField(
1348 [
'change_tag',
'change_tag_def' ],
1350 [
'ct_rev_id' => $revId ],
1352 [
'change_tag_def' => [
'JOIN',
'ctd_id = ct_tag_id' ] ]
1358 $name =
'Help:' . ucfirst( __FUNCTION__ );
1361 'You do not have permission to apply change tags along with your changes.' );
1367 [
'user' => [
'applychangetags' =>
true ] ] );
1372 'text' =>
'Some text',
1373 'tags' =>
'custom tag',
1381 $name =
'Help:' . ucfirst( __FUNCTION__ );
1384 'The modification you tried to make was aborted by an extension.' );
1387 'hook-APIEditBeforeSave-closure)' );
1399 'text' =>
'Some text',
1407 $name =
'Help:' . ucfirst( __FUNCTION__ );
1410 'hook-APIEditBeforeSave-closure)' );
1413 function ( $unused1, $unused2, &$r ) {
1414 $r[
'msg'] =
'Some message';
1421 'text' =>
'Some text',
1423 Wikimedia\restoreWarnings();
1425 $this->assertSame( [
'msg' =>
'Some message',
'result' =>
'Failure' ],
1432 $name =
'Help:' . ucfirst( __FUNCTION__ );
1436 $status->apiHookResult = [
'msg' =>
'A message for you!' ];
1443 'text' =>
'Some text',
1447 $this->assertSame( [
'edit' => [
'msg' =>
'A message for you!',
1448 'result' =>
'Failure' ] ],
$res[0] );
1452 $name =
'Help:' . ucfirst( __FUNCTION__ );
1455 'The modification you tried to make was aborted by an extension.' );
1467 'text' =>
'Some text',
1475 $name =
'Help:' . ucfirst( __FUNCTION__ );
1479 $block =
new Block( [
1480 'address' => self::$users[
'sysop']->getUser()->getName(),
1481 'by' => self::$users[
'sysop']->getUser()->getId(),
1482 'reason' =>
'Capriciousness',
1483 'timestamp' =>
'19370101000000',
1484 'expiry' =>
'infinity',
1485 'enableAutoblock' =>
true,
1493 'text' =>
'Some text',
1495 $this->fail(
'Expected exception not thrown' );
1497 $this->assertSame(
'You have been blocked from editing.', $ex->getMessage() );
1501 self::$users[
'sysop']->getUser()->clearInstanceCache();
1506 $name =
'Help:' . ucfirst( __FUNCTION__ );
1509 'The wiki is currently in read-only mode.' );
1511 $svc = \MediaWiki\MediaWikiServices::getInstance()->getReadOnlyMode();
1512 $svc->setReason(
"Read-only for testing" );
1518 'text' =>
'Some text',
1521 $svc->setReason(
false );
1526 $name =
'File:' . ucfirst( __FUNCTION__ );
1529 "Anonymous users can't create image redirects." );
1534 'text' =>
'#REDIRECT [[File:Other file.png]]',
1535 ],
null,
new User() );
1539 $name =
'File:' . ucfirst( __FUNCTION__ );
1542 "You don't have permission to create image redirects." );
1545 [
'user' => [
'upload' =>
true ] ] );
1550 'text' =>
'#REDIRECT [[File:Other file.png]]',
1555 $name =
'Help:' . ucfirst( __FUNCTION__ );
1558 'The content you supplied exceeds the article size limit of 1 kilobyte.' );
1562 $text = str_repeat(
'!', 1025 );
1572 $name =
'Help:' . ucfirst( __FUNCTION__ );
1575 'The action you have requested is limited to users in the group: ' );
1577 $this->
setMwGlobals(
'wgRevokePermissions', [
'*' => [
'edit' =>
true ] ] );
1582 'text' =>
'Some text',
1583 ],
null,
new User() );
1587 $name =
'Help:' . ucfirst( __FUNCTION__ );
1590 "You don't have permission to change the content model of a page." );
1593 [
'user' => [
'editcontentmodel' =>
true ] ] );
1598 'text' =>
'Some text',
1599 'contentmodel' =>
'json',