22 'wgExtraNamespaces' => $wgExtraNamespaces,
39 'DummySerializeErrorContentHandler';
55 $name =
'Help:ApiEditPageTest_testEdit';
61 'text' =>
'some text',
63 $apiResult = $apiResult[0];
66 $this->assertArrayHasKey(
'edit', $apiResult );
67 $this->assertArrayHasKey(
'result', $apiResult[
'edit'] );
68 $this->assertSame(
'Success', $apiResult[
'edit'][
'result'] );
70 $this->assertArrayHasKey(
'new', $apiResult[
'edit'] );
71 $this->assertArrayNotHasKey(
'nochange', $apiResult[
'edit'] );
73 $this->assertArrayHasKey(
'pageid', $apiResult[
'edit'] );
79 'text' =>
'some text',
82 $this->assertSame(
'Success', $data[0][
'edit'][
'result'] );
84 $this->assertArrayNotHasKey(
'new', $data[0][
'edit'] );
85 $this->assertArrayHasKey(
'nochange', $data[0][
'edit'] );
91 'text' =>
'different text'
94 $this->assertSame(
'Success', $data[0][
'edit'][
'result'] );
96 $this->assertArrayNotHasKey(
'new', $data[0][
'edit'] );
97 $this->assertArrayNotHasKey(
'nochange', $data[0][
'edit'] );
99 $this->assertArrayHasKey(
'oldrevid', $data[0][
'edit'] );
100 $this->assertArrayHasKey(
'newrevid', $data[0][
'edit'] );
101 $this->assertNotEquals(
102 $data[0][
'edit'][
'newrevid'],
103 $data[0][
'edit'][
'oldrevid'],
104 "revision id should change after edit"
114 'foo',
'append',
'bar',
"foobar"
117 'foo',
'prepend',
'bar',
"barfoo"
119 [ # 2: append to empty
page
120 '',
'append',
'foo',
"foo"
122 [ # 3: prepend to empty
page
123 '',
'prepend',
'foo',
"foo"
125 [ # 4: append to non-existing
page
126 null,
'append',
'foo',
"foo"
128 [ # 5: prepend to non-existing
page
129 null,
'prepend',
'foo',
"foo"
142 $name =
"Help:ApiEditPageTest_testEditAppend_$count";
145 if ( $text !==
null ) {
149 'text' => $text, ] );
151 $this->assertSame(
'Success', $re[
'edit'][
'result'] );
158 $op .
'text' => $append, ] );
160 $this->assertSame(
'Success', $re[
'edit'][
'result'] );
164 $content = $page->getContent();
165 $this->assertNotNull( $content,
'Page should have been created' );
167 $text = $content->getNativeData();
169 $this->assertSame( $expected, $text );
176 $name =
'Help:ApiEditPageTest_testEditSection';
178 $text =
"==section 1==\ncontent 1\n==section 2==\ncontent2";
186 'text' =>
"==section 1==\nnew content 1",
188 $this->assertSame(
'Success', $re[
'edit'][
'result'] );
192 $this->assertSame(
"==section 1==\nnew content 1\n\n==section 2==\ncontent2", $newtext );
202 $this->fail(
"Should have raised an ApiUsageException" );
204 $this->assertTrue( self::apiExceptionHasCode(
$e,
'nosuchsection' ) );
215 $name =
'Help:ApiEditPageTest_testEditNewSection';
224 'summary' =>
'header',
227 $this->assertSame(
'Success', $re[
'edit'][
'result'] );
232 $this->assertSame(
"== header ==\n\ntest", $text );
241 'summary' =>
'header',
244 $this->assertSame(
'Success', $re2[
'edit'][
'result'] );
248 $this->assertSame(
"== header ==\n\ntest\n\n== header ==\n\ntest", $text );
259 $name =
"Help:ApiEditPageTest_testEdit_redirect_$count";
263 $rname =
"Help:ApiEditPageTest_testEdit_redirect_r$count";
269 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
271 $baseTime = $page->getRevision()->getTimestamp();
275 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
279 $rpage->doEditContent(
new WikitextContent(
"#REDIRECT [[$name]]\n\n[[Category:Test]]" ),
280 "testing 2",
EDIT_UPDATE, $page->getLatest(), self::$users[
'uploader']->getUser() );
287 'text' =>
'nix bar!',
288 'basetimestamp' => $baseTime,
293 $this->assertSame(
'Success', $re[
'edit'][
'result'],
294 "no problems expected when following redirect" );
305 $name =
"Help:ApiEditPageTest_testEdit_redirectText_$count";
309 $rname =
"Help:ApiEditPageTest_testEdit_redirectText_r$count";
315 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
317 $baseTime = $page->getRevision()->getTimestamp();
321 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
325 $rpage->doEditContent(
new WikitextContent(
"#REDIRECT [[$name]]\n\n[[Category:Test]]" ),
326 "testing 2",
EDIT_UPDATE, $page->getLatest(), self::$users[
'uploader']->getUser() );
334 'text' =>
'nix bar!',
335 'basetimestamp' => $baseTime,
339 $this->fail(
'redirect-appendonly error expected' );
341 $this->assertTrue( self::apiExceptionHasCode( $ex,
'redirect-appendonly' ) );
350 $name =
"Help:ApiEditPageTest_testEditConflict_$count";
357 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
359 $baseTime = $page->getRevision()->getTimestamp();
363 "testing 2",
EDIT_UPDATE, $page->getLatest(), self::$users[
'uploader']->getUser() );
371 'text' =>
'nix bar!',
372 'basetimestamp' => $baseTime,
375 $this->fail(
'edit conflict expected' );
377 $this->assertTrue( self::apiExceptionHasCode( $ex,
'editconflict' ) );
389 $name =
"Help:ApiEditPageTest_testEditConflict_newSection_$count";
396 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
398 $baseTime = $page->getRevision()->getTimestamp();
402 "testing 2",
EDIT_UPDATE, $page->getLatest(), self::$users[
'uploader']->getUser() );
409 'text' =>
'nix bar!',
410 'basetimestamp' => $baseTime,
414 $this->assertSame(
'Success', $re[
'edit'][
'result'],
415 "no edit conflict expected here" );
429 $name =
"Help:ApiEditPageTest_testEditConflict_redirect_bug41990_$count";
433 $rname =
"Help:ApiEditPageTest_testEditConflict_redirect_bug41990_r$count";
439 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
444 "testing 1",
EDIT_NEW,
false, self::$users[
'sysop']->getUser() );
449 "testing 2",
EDIT_UPDATE, $page->getLatest(), self::$users[
'uploader']->getUser() );
456 'text' =>
'nix bar!',
461 $this->assertSame(
'Success', $re[
'edit'][
'result'],
462 "no edit conflict expected here" );
472 $dbw->update(
'revision',
473 [
'rev_timestamp' => $dbw->timestamp( $timestamp ) ],
480 $this->setExpectedException(
482 'Direct editing via API is not supported for content model ' .
483 'testing used by Dummy:ApiEditPageTest_nonTextPageEdit'
488 'title' =>
'Dummy:ApiEditPageTest_nonTextPageEdit',
489 'text' =>
'{"animals":["kittens!"]}'
494 $name =
'DummyNonText:ApiEditPageTest_testNonTextEdit';
495 $data =
serialize(
'some bla bla text' );
506 $this->assertArrayHasKey(
'edit', $apiResult );
507 $this->assertArrayHasKey(
'result', $apiResult[
'edit'] );
508 $this->assertSame(
'Success', $apiResult[
'edit'][
'result'] );
510 $this->assertArrayHasKey(
'new', $apiResult[
'edit'] );
511 $this->assertArrayNotHasKey(
'nochange', $apiResult[
'edit'] );
513 $this->assertArrayHasKey(
'pageid', $apiResult[
'edit'] );
517 $this->assertSame(
"testing-nontext", $page->getContentModel() );
518 $this->assertSame( $data, $page->getContent()->serialize() );
527 $name =
'Help:' . __FUNCTION__;
528 $uploader = self::$users[
'uploader']->getUser();
529 $sysop = self::$users[
'sysop']->getUser();
534 'text' =>
'some text',
535 ],
null, $sysop )[0];
538 $this->assertArrayHasKey(
'edit', $apiResult );
539 $this->assertArrayHasKey(
'result', $apiResult[
'edit'] );
540 $this->assertSame(
'Success', $apiResult[
'edit'][
'result'] );
541 $this->assertArrayHasKey(
'contentmodel', $apiResult[
'edit'] );
543 $this->assertSame(
'wikitext', $apiResult[
'edit'][
'contentmodel'] );
550 'contentmodel' =>
'json',
551 ],
null, $uploader )[0];
554 $this->assertArrayHasKey(
'edit', $apiResult );
555 $this->assertArrayHasKey(
'result', $apiResult[
'edit'] );
556 $this->assertSame(
'Success', $apiResult[
'edit'][
'result'] );
557 $this->assertArrayHasKey(
'contentmodel', $apiResult[
'edit'] );
558 $this->assertSame(
'json', $apiResult[
'edit'][
'contentmodel'] );
563 'undo' => $apiResult[
'edit'][
'newrevid']
564 ],
null, $sysop )[0];
567 $this->assertArrayHasKey(
'edit', $apiResult );
568 $this->assertArrayHasKey(
'result', $apiResult[
'edit'] );
569 $this->assertSame(
'Success', $apiResult[
'edit'][
'result'] );
570 $this->assertArrayHasKey(
'contentmodel', $apiResult[
'edit'] );
572 $this->assertSame(
'wikitext', $apiResult[
'edit'][
'contentmodel'] );
579 $name =
'Help:' . ucfirst( __FUNCTION__ );
584 'text' =>
'some text',
585 'contentmodel' =>
'wikitext',
586 'contentformat' =>
'text/x-wiki',
593 $name =
'Help:' . ucfirst( __FUNCTION__ );
596 'Unrecognized value for parameter "contentformat": nonexistent format.' );
602 'text' =>
'some text',
603 'contentformat' =>
'nonexistent format',
611 $name =
'Help:' . ucfirst( __FUNCTION__ );
614 'The requested format text/plain is not supported for content ' .
615 "model wikitext used by $name." );
621 'text' =>
'some text',
622 'contentmodel' =>
'wikitext',
623 'contentformat' =>
'text/plain',
631 $name =
'Help:' . ucfirst( __FUNCTION__ );
633 $revId = $this->
editPage(
$name,
'Some text' )->value[
'revision']
638 "There is no revision with ID $revId." );
661 $name =
'Help:' . ucfirst( __FUNCTION__ );
664 $revId1 = $this->
editPage(
$name,
'1' )->value[
'revision']->getId();
665 $revId2 = $this->
editPage(
$name,
'2' )->value[
'revision']->getId();
666 $revId3 = $this->
editPage(
$name,
'3' )->value[
'revision']->getId();
670 $dbw->delete(
'revision', [
'rev_id' => $revId2 ], __METHOD__ );
671 $dbw->update(
'revision', [
'rev_parent_id' => $revId1 ],
672 [
'rev_id' => $revId3 ], __METHOD__ );
675 "There is no revision with ID $revId2." );
681 'undoafter' => $revId2,
690 $name =
'Help:' . ucfirst( __FUNCTION__ );
695 $revId1 = $this->
editPage(
$name,
'1' )->value[
'revision']->getId();
697 $revId2 = $this->
editPage(
$name,
'2' )->value[
'revision']->getId();
702 $list->setVisibility( [
704 'comment' =>
'Bye-bye',
708 "There is no revision with ID $revId1." );
714 'undoafter' => $revId1,
723 $name =
'Help:' . ucfirst( __FUNCTION__ );
728 $revId2 = $this->
editPage(
$name,
'2' )->value[
'revision']->getId();
730 $revId1 = $this->
editPage(
$name,
'1' )->value[
'revision']->getId();
736 [
'rev_timestamp' =>
wfTimestamp( TS_MW, time() - 86400 ) ],
737 [
'rev_id' => $revId1 ],
745 'undoafter' => $revId1,
748 $text = (
new WikiPage( $titleObj ) )->getContent()->getNativeData();
754 $this->assertSame(
'2', $text );
758 $name =
'Help:' . ucfirst( __FUNCTION__ );
761 'The edit could not be undone due to conflicting intermediate edits.' );
765 $revId = $this->
editPage(
$name,
'2' )->value[
'revision']->getId();
777 $this->assertSame(
'3', $text );
785 $name =
'Help:' . ucfirst( __FUNCTION__ );
788 $revId1 = $this->
editPage(
$name,
'1' )->value[
'revision']->getId();
789 $revId2 = $this->
editPage(
$name,
'2' )->value[
'revision']->getId();
795 'undoafter' => $revId2,
800 $this->assertSame(
'1', $text );
804 $name =
'Help:' . ucfirst( __FUNCTION__ );
806 $this->
editPage(
"$name-1",
'Some text' );
807 $revId = $this->
editPage(
"$name-1",
'Some more text' )
808 ->value[
'revision']->getId();
810 $this->
editPage(
"$name-2",
'Some text' );
813 "r$revId is not a revision of $name-2." );
817 'title' =>
"$name-2",
823 $name =
'Help:' . ucfirst( __FUNCTION__ );
825 $revId1 = $this->
editPage(
"$name-1",
'Some text' )
826 ->value[
'revision']->getId();
828 $revId2 = $this->
editPage(
"$name-2",
'Some text' )
829 ->value[
'revision']->getId();
832 "r$revId1 is not a revision of $name-2." );
836 'title' =>
"$name-2",
838 'undoafter' => $revId1,
843 $name =
'Help:' . ucfirst( __FUNCTION__ );
850 'text' =>
'Some text',
851 'md5' => md5(
'Some text' ),
858 $name =
'Help:' . ucfirst( __FUNCTION__ );
865 'prependtext' =>
'Alert: ',
866 'md5' => md5(
'Alert: ' ),
870 ->getContent()->getNativeData();
871 $this->assertSame(
'Alert: Some text', $text );
875 $name =
'Help:' . ucfirst( __FUNCTION__ );
882 'appendtext' =>
' is nice',
883 'md5' => md5(
' is nice' ),
887 ->getContent()->getNativeData();
888 $this->assertSame(
'Some text is nice', $text );
892 $name =
'Help:' . ucfirst( __FUNCTION__ );
899 'prependtext' =>
'Alert: ',
900 'appendtext' =>
' is nice',
901 'md5' => md5(
'Alert: is nice' ),
905 ->getContent()->getNativeData();
906 $this->assertSame(
'Alert: Some text is nice', $text );
910 $name =
'Help:' . ucfirst( __FUNCTION__ );
913 'The supplied MD5 hash was incorrect.' );
918 'text' =>
'Some text',
924 $name =
'Help:' . ucfirst( __FUNCTION__ );
927 'The supplied MD5 hash was incorrect.' );
932 'prependtext' =>
'Some ',
933 'appendtext' =>
'text',
934 'md5' => md5(
'Some ' ),
939 $name =
'Help:' . ucfirst( __FUNCTION__ );
942 'The supplied MD5 hash was incorrect.' );
947 'prependtext' =>
'Some ',
948 'appendtext' =>
'text',
949 'md5' => md5(
'text' ),
954 $name =
'Help:' . ucfirst( __FUNCTION__ );
957 'The article you tried to create has been created already.' );
966 'text' =>
'Some more text',
972 ->getContent()->getNativeData();
974 $this->assertSame(
'Some text', $text );
979 $name =
'Help:' . ucfirst( __FUNCTION__ );
982 "The page you specified doesn't exist." );
990 'text' =>
'Some text',
1004 $name =
'MediaWiki:' . ucfirst( __FUNCTION__ );
1007 "Can't append to pages using content model testing-nontext." );
1012 $model =
'testing-nontext';
1021 'appendtext' =>
'Some text',
1026 $name =
'MediaWiki:' . ucfirst( __FUNCTION__ );
1033 'appendtext' =>
'Some text',
1040 $name =
'MediaWiki:' . ucfirst( __FUNCTION__ );
1043 'Content serialization failed: Could not unserialize content' );
1048 $model =
'testing-serialize-error';
1057 'appendtext' =>
'Some text',
1062 $name =
'Help:' . ucfirst( __FUNCTION__ );
1069 'appendtext' =>
'== New section ==',
1074 ->getContent()->getNativeData();
1076 $this->assertSame(
"Initial content\n\n== New section ==", $text );
1080 $name =
'Help:' . ucfirst( __FUNCTION__ );
1083 'Sections are not supported for content model text.' );
1090 'appendtext' =>
'== New section ==',
1092 'contentmodel' =>
'text',
1097 $name =
'Help:' . ucfirst( __FUNCTION__ );
1104 'sectiontitle' =>
'My section',
1105 'appendtext' =>
'More content',
1111 $this->assertSame(
"Initial content\n\n== My section ==\n\nMore content",
1112 $page->getContent()->getNativeData() );
1113 $this->assertSame(
'/* My section */ new section',
1114 $page->getRevision()->getComment() );
1118 $name =
'Help:' . ucfirst( __FUNCTION__ );
1125 'appendtext' =>
'More content',
1127 'summary' =>
'Add new section',
1132 $this->assertSame(
"Initial content\n\n== Add new section ==\n\nMore content",
1133 $page->getContent()->getNativeData() );
1135 $this->assertSame(
'/* Add new section */ new section',
1136 $page->getRevision()->getComment() );
1140 $name =
'Help:' . ucfirst( __FUNCTION__ );
1147 'sectiontitle' =>
'My section',
1148 'appendtext' =>
'More content',
1150 'summary' =>
'Add new section',
1155 $this->assertSame(
"Initial content\n\n== My section ==\n\nMore content",
1156 $page->getContent()->getNativeData() );
1157 $this->assertSame(
'Add new section',
1158 $page->getRevision()->getComment() );
1162 $name =
'Help:' . ucfirst( __FUNCTION__ );
1165 "== Section 2 ==\n\nFascinating!" );
1170 'appendtext' =>
' and more content',
1175 ->getContent()->getNativeData();
1177 $this->assertSame(
"== Section 1 ==\n\nContent and more content\n\n" .
1178 "== Section 2 ==\n\nFascinating!", $text );
1182 $name =
'Help:' . ucfirst( __FUNCTION__ );
1184 $this->
editPage(
$name,
"Content\n\n== Section 1 ==\n\nFascinating!" );
1189 'appendtext' =>
' and more content',
1194 ->getContent()->getNativeData();
1196 $this->assertSame(
"Content and more content\n\n== Section 1 ==\n\n" .
1197 "Fascinating!", $text );
1201 $name =
'Help:' . ucfirst( __FUNCTION__ );
1211 'appendtext' =>
' and more content',
1216 ->getContent()->getNativeData();
1218 $this->assertSame(
'Content', $text );
1223 $name =
'Help:' . ucfirst( __FUNCTION__ );
1226 'The "section" parameter must be a valid section ID or "new".' );
1233 'text' =>
'Different content',
1234 'section' =>
'It is unlikely that this is valid',
1238 ->getContent()->getNativeData();
1240 $this->assertSame(
'Content', $text );
1245 $name =
'Help:' . ucfirst( __FUNCTION__ );
1247 'The page has been deleted since you fetched its timestamp.' );
1249 $startTime = MWTimestamp::convert( TS_MW, time() - 1 );
1254 $pageObj->doDeleteArticle(
'Bye-bye' );
1256 $this->assertFalse( $pageObj->exists() );
1262 'text' =>
'Different text',
1263 'starttimestamp' => $startTime,
1266 $this->assertFalse( $pageObj->exists() );
1271 $name =
'Help:' . ucfirst( __FUNCTION__ );
1278 'text' =>
'Different text',
1282 $revisionStore = \MediaWiki\MediaWikiServices::getInstance()->getRevisionStore();
1284 $this->assertTrue( $revision->isMinor() );
1288 $name =
'Help:' . ucfirst( __FUNCTION__ );
1290 $startTime = MWTimestamp::convert( TS_MW, time() - 1 );
1295 $pageObj->doDeleteArticle(
'Bye-bye' );
1297 $this->assertFalse( $pageObj->exists() );
1302 'text' =>
'Different text',
1303 'starttimestamp' => $startTime,
1311 $name =
'Help:' . ucfirst( __FUNCTION__ );
1312 $user = self::$users[
'sysop']->getUser();
1317 'text' =>
'Some text',
1326 $name =
'Help:' . ucfirst( __FUNCTION__ );
1327 $user = self::$users[
'sysop']->getUser();
1330 $user->addWatch( $titleObj );
1332 $this->assertFalse( $titleObj->exists() );
1333 $this->assertTrue(
$user->isWatched( $titleObj ) );
1338 'text' =>
'Some text',
1342 $this->assertTrue( $titleObj->exists() );
1343 $this->assertFalse(
$user->isWatched( $titleObj ) );
1347 $name =
'Help:' . ucfirst( __FUNCTION__ );
1354 'text' =>
'Some text',
1355 'tags' =>
'custom tag',
1356 ] )[0][
'edit'][
'newrevid'];
1359 $this->assertSame(
'custom tag', $dbw->selectField(
1360 'change_tag',
'ct_tag', [
'ct_rev_id' => $revId ], __METHOD__ ) );
1364 $name =
'Help:' . ucfirst( __FUNCTION__ );
1367 'You do not have permission to apply change tags along with your changes.' );
1373 [
'user' => [
'applychangetags' =>
true ] ] );
1378 'text' =>
'Some text',
1379 'tags' =>
'custom tag',
1387 $name =
'Help:' . ucfirst( __FUNCTION__ );
1390 'The modification you tried to make was aborted by an extension.' );
1393 'hook-APIEditBeforeSave-closure)' );
1405 'text' =>
'Some text',
1413 $name =
'Help:' . ucfirst( __FUNCTION__ );
1416 'hook-APIEditBeforeSave-closure)' );
1419 function ( $unused1, $unused2, &$r ) {
1420 $r[
'msg'] =
'Some message';
1427 'text' =>
'Some text',
1429 Wikimedia\restoreWarnings();
1431 $this->assertSame( [
'msg' =>
'Some message',
'result' =>
'Failure' ],
1438 $name =
'Help:' . ucfirst( __FUNCTION__ );
1442 $status->apiHookResult = [
'msg' =>
'A message for you!' ];
1449 'text' =>
'Some text',
1453 $this->assertSame( [
'edit' => [
'msg' =>
'A message for you!',
1454 'result' =>
'Failure' ] ],
$res[0] );
1458 $name =
'Help:' . ucfirst( __FUNCTION__ );
1461 'The modification you tried to make was aborted by an extension.' );
1473 'text' =>
'Some text',
1481 $name =
'Help:' . ucfirst( __FUNCTION__ );
1484 'You have been blocked from editing.' );
1486 $block =
new Block( [
1487 'address' => self::$users[
'sysop']->getUser()->getName(),
1488 'by' => self::$users[
'sysop']->getUser()->getId(),
1489 'reason' =>
'Capriciousness',
1490 'timestamp' =>
'19370101000000',
1491 'expiry' =>
'infinity',
1499 'text' =>
'Some text',
1503 self::$users[
'sysop']->getUser()->clearInstanceCache();
1508 $name =
'Help:' . ucfirst( __FUNCTION__ );
1511 'The wiki is currently in read-only mode.' );
1513 $svc = \MediaWiki\MediaWikiServices::getInstance()->getReadOnlyMode();
1514 $svc->setReason(
"Read-only for testing" );
1520 'text' =>
'Some text',
1523 $svc->setReason(
false );
1528 $name =
'File:' . ucfirst( __FUNCTION__ );
1531 "Anonymous users can't create image redirects." );
1536 'text' =>
'#REDIRECT [[File:Other file.png]]',
1537 ],
null,
new User() );
1541 $name =
'File:' . ucfirst( __FUNCTION__ );
1544 "You don't have permission to create image redirects." );
1547 [
'user' => [
'upload' =>
true ] ] );
1552 'text' =>
'#REDIRECT [[File:Other file.png]]',
1557 $name =
'Help:' . ucfirst( __FUNCTION__ );
1560 'The content you supplied exceeds the article size limit of 1 kilobyte.' );
1564 $text = str_repeat(
'!', 1025 );
1574 $name =
'Help:' . ucfirst( __FUNCTION__ );
1577 'The action you have requested is limited to users in the group: ' );
1579 $this->
setMwGlobals(
'wgRevokePermissions', [
'*' => [
'edit' =>
true ] ] );
1584 'text' =>
'Some text',
1585 ],
null,
new User() );
1589 $name =
'Help:' . ucfirst( __FUNCTION__ );
1592 "You don't have permission to change the content model of a page." );
1595 [
'user' => [
'editcontentmodel' =>
true ] ] );
1600 'text' =>
'Some text',
1601 'contentmodel' =>
'json',