17 parent::__construct(
$name,
$data, $dataName );
18 $this->tablesUsed = array_unique(
19 array_merge( $this->tablesUsed, [
'watchlist',
'recentchanges',
'page' ] )
30 return self::$users[
'ApiQueryWatchlistIntegrationTestUser']->getUser();
34 return self::$users[
'ApiQueryWatchlistIntegrationTestUser2']->getUser();
38 $title = Title::newFromLinkTarget( $target );
39 $page = WikiPage::factory(
$title );
50 $title = Title::newFromLinkTarget( $target );
51 $page = WikiPage::factory(
$title );
62 $title = Title::newFromLinkTarget( $target );
63 $page = WikiPage::factory(
$title );
74 $title = Title::newFromLinkTarget( $target );
75 $page = WikiPage::factory(
$title );
92 $title = Title::newFromLinkTarget( $target );
93 $summary = CommentStoreComment::newUnsavedComment( trim( $summary ) );
94 $page = WikiPage::factory(
$title );
100 $rc = MediaWikiServices::getInstance()->getRevisionStore()->getRecentChange(
$rev );
101 $rc->doMarkPatrolled( $patrollingUser,
false, [] );
105 $title = Title::newFromLinkTarget( $target );
106 $page = WikiPage::factory(
$title );
107 $page->doDeleteArticleReal( $reason );
121 foreach ( $editData
as $singleEditData ) {
122 if ( array_key_exists(
'minorEdit', $singleEditData ) && $singleEditData[
'minorEdit'] ) {
125 $singleEditData[
'target'],
126 $singleEditData[
'content'],
127 $singleEditData[
'summary']
131 if ( array_key_exists(
'botEdit', $singleEditData ) && $singleEditData[
'botEdit'] ) {
134 $singleEditData[
'target'],
135 $singleEditData[
'content'],
136 $singleEditData[
'summary']
142 $singleEditData[
'target'],
143 $singleEditData[
'content'],
144 $singleEditData[
'summary']
150 return MediaWikiServices::getInstance()->getWatchedItemStore();
159 $store->addWatchBatchForUser(
$user, $targets );
163 if (
$user ===
null ) {
168 [
'action' =>
'query',
'list' =>
'watchlist' ],
170 ),
null,
false,
$user
177 [
'action' =>
'query',
'generator' =>
'watchlist' ],
184 return $response[0][
'query'][
'watchlist'];
205 array $expectedItems,
206 array $keysUsedInValueComparison,
207 array $requiredKeys = []
209 $this->assertCount( count( $expectedItems ), $actualItems );
212 $actualItemsOnlyComparedValues = array_map(
213 function (
array $item )
use ( $keysUsedInValueComparison ) {
214 return array_intersect_key( $item, array_flip( $keysUsedInValueComparison ) );
221 $actualItemsOnlyComparedValues
225 $actualItemsKeysOnly = array_map(
'array_keys', $actualItems );
226 foreach ( $actualItemsKeysOnly
as $keysOfTheItem ) {
227 $this->assertEmpty( array_diff( $requiredKeys, $keysOfTheItem ) );
233 Language::factory(
'en' ),
234 MediaWikiServices::getInstance()->getGenderCache()
240 return $formatter->getPrefixedText( $target );
246 $items = $store->getWatchedItemsForUser(
$user );
247 foreach ( $items
as $item ) {
248 $store->removeWatch(
$user, $item->getLinkTarget() );
258 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
269 $this->assertArrayHasKey(
'query',
$result[0] );
270 $this->assertArrayHasKey(
'watchlist',
$result[0][
'query'] );
277 'ns' => $target->getNamespace(),
278 'title' => $this->getPrefixedText( $target ),
284 [
'type',
'ns',
'title',
'bot',
'new',
'minor' ],
285 [
'pageid',
'revid',
'old_revid' ]
291 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
303 $this->assertCount( 1, $items );
304 $this->assertArrayHasKey(
'pageid', $items[0] );
305 $this->assertArrayHasKey(
'revid', $items[0] );
306 $this->assertArrayHasKey(
'old_revid', $items[0] );
307 $this->assertEquals(
'new', $items[0][
'type'] );
312 $subjectTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
313 $talkTarget =
new TitleValue( 1,
'ApiQueryWatchlistIntegrationTestPage' );
318 'target' => $subjectTarget,
319 'content' =>
'Some Content',
320 'summary' =>
'Create the page',
323 'target' => $talkTarget,
324 'content' =>
'Some Talk Page Content',
325 'summary' =>
'Create Talk page',
337 'ns' => $talkTarget->getNamespace(),
338 'title' => $this->getPrefixedText( $talkTarget ),
342 'ns' => $subjectTarget->getNamespace(),
343 'title' => $this->getPrefixedText( $subjectTarget ),
346 $this->getItemsFromApiResponse(
$result )
352 $normalEditTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
353 $minorEditTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPageM' );
354 $botEditTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPageB' );
359 'target' => $normalEditTarget,
360 'content' =>
'Some Content',
361 'summary' =>
'Create the page',
364 'target' => $minorEditTarget,
365 'content' =>
'Some Content',
366 'summary' =>
'Create the page',
369 'target' => $minorEditTarget,
370 'content' =>
'Slightly Better Content',
371 'summary' =>
'Change content',
375 'target' => $botEditTarget,
376 'content' =>
'Some Content',
377 'summary' =>
'Create the page with a bot',
382 $this->
watchPages(
$user, [ $normalEditTarget, $minorEditTarget, $botEditTarget ] );
413 $userEditTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
414 $anonEditTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPageA' );
439 'user' =>
$user->getName(),
442 $this->getItemsFromApiResponse(
$result )
448 $userEditTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
449 $anonEditTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPageA' );
475 'user' =>
$user->getId(),
476 'userid' =>
$user->getId(),
479 $this->getItemsFromApiResponse(
$result )
485 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
490 'Create the <b>page</b>'
500 'comment' =>
'Create the <b>page</b>',
509 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
514 'Create the <b>page</b>'
524 'parsedcomment' =>
'Create the <b>page</b>',
533 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
545 $this->assertCount( 1, $items );
546 $this->assertArrayHasKey(
'timestamp', $items[0] );
547 $this->assertInternalType(
'string', $items[0][
'timestamp'] );
552 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
577 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
586 $store->updateNotificationTimestamp(
598 'notificationtimestamp' =>
'2015-12-12T01:01:01Z',
606 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
612 'Create the page (this gets patrolled)',
620 $testUser = static::getTestSysop();
621 $user = $testUser->getUser();
631 'unpatrolled' =>
false,
632 'autopatrolled' =>
false,
644 'Create the page that will be deleted'
646 $this->
deletePage( $target,
'Important Reason' );
650 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
662 'logtype' =>
'delete',
663 'logaction' =>
'delete',
667 [
'type',
'logtype',
'logaction',
'logparams' ],
674 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
697 $subjectTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
698 $talkTarget =
new TitleValue( 1,
'ApiQueryWatchlistIntegrationTestPage' );
703 'target' => $subjectTarget,
704 'content' =>
'Some Content',
705 'summary' =>
'Create the page',
708 'target' => $talkTarget,
709 'content' =>
'Some Content',
710 'summary' =>
'Create the talk page',
733 $subjectTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
734 $talkTarget =
new TitleValue( 1,
'ApiQueryWatchlistIntegrationTestPage' );
744 'What is this page about?',
745 'Create the talk page'
750 'wlprop' =>
'user|title',
751 'wluser' => $otherUser->getName(),
758 'ns' => $talkTarget->getNamespace(),
759 'title' => $this->getPrefixedText( $talkTarget ),
760 'user' => $otherUser->getName(),
763 $this->getItemsFromApiResponse(
$result )
770 $subjectTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
771 $talkTarget =
new TitleValue( 1,
'ApiQueryWatchlistIntegrationTestPage' );
781 'What is this page about?',
782 'Create the talk page'
787 'wlprop' =>
'user|title',
788 'wlexcludeuser' => $otherUser->getName(),
795 'ns' => $subjectTarget->getNamespace(),
796 'title' => $this->getPrefixedText( $subjectTarget ),
797 'user' =>
$user->getName(),
800 $this->getItemsFromApiResponse(
$result )
806 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
812 'content' =>
'Some Content',
813 'summary' =>
'Create the page',
817 'content' =>
'Slightly Better Content',
818 'summary' =>
'Change content',
826 'wlshow' => WatchedItemQueryService::FILTER_MINOR,
830 'wlshow' => WatchedItemQueryService::FILTER_NOT_MINOR,
'wlprop' =>
'flags'
845 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
855 'wlshow' => WatchedItemQueryService::FILTER_BOT
858 'wlshow' => WatchedItemQueryService::FILTER_NOT_BOT
873 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
883 'wlshow' => WatchedItemQueryService::FILTER_ANON
887 'wlshow' => WatchedItemQueryService::FILTER_NOT_ANON
903 $subjectTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
904 $talkTarget =
new TitleValue( 1,
'ApiQueryWatchlistIntegrationTestPage' );
915 'Create the talk page'
918 $store->addWatchBatchForUser(
$user, [ $subjectTarget, $talkTarget ] );
919 $store->updateNotificationTimestamp(
926 'wlprop' =>
'notificationtimestamp|title',
927 'wlshow' => WatchedItemQueryService::FILTER_UNREAD
930 'wlprop' =>
'notificationtimestamp|title',
931 'wlshow' => WatchedItemQueryService::FILTER_NOT_UNREAD
938 'notificationtimestamp' =>
'2015-12-12T01:01:01Z',
939 'ns' => $talkTarget->getNamespace(),
940 'title' => $this->getPrefixedText( $talkTarget )
943 $this->getItemsFromApiResponse( $resultUnread )
949 'notificationtimestamp' =>
'',
950 'ns' => $subjectTarget->getNamespace(),
951 'title' => $this->getPrefixedText( $subjectTarget )
954 $this->getItemsFromApiResponse( $resultNotUnread )
959 $user = static::getTestSysop()->getUser();
963 'wlprop' =>
'patrol',
964 'wlshow' => WatchedItemQueryService::FILTER_PATROLLED
967 'wlprop' =>
'patrol',
968 'wlshow' => WatchedItemQueryService::FILTER_NOT_PATROLLED
976 'unpatrolled' =>
false,
977 'autopatrolled' =>
false,
987 $subjectTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
988 $talkTarget =
new TitleValue( 1,
'ApiQueryWatchlistIntegrationTestPage' );
993 'target' => $subjectTarget,
994 'content' =>
'Some Content',
995 'summary' =>
'Create the page',
998 'target' => $subjectTarget,
999 'content' =>
'Some Other Content',
1000 'summary' =>
'Change the content',
1003 'target' => $talkTarget,
1004 'content' =>
'Some Talk Page Content',
1005 'summary' =>
'Create Talk page',
1014 $this->assertEquals(
1018 'ns' => $talkTarget->getNamespace(),
1019 'title' => $this->getPrefixedText( $talkTarget ),
1022 $this->getItemsFromApiResponse( $resultNew )
1024 $this->assertEquals(
1028 'ns' => $subjectTarget->getNamespace(),
1029 'title' => $this->getPrefixedText( $subjectTarget ),
1032 $this->getItemsFromApiResponse( $resultEdit )
1038 $subjectTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
1039 $talkTarget =
new TitleValue( 1,
'ApiQueryWatchlistIntegrationTestPage' );
1044 'Some Talk Page Content',
1051 $this->assertEquals(
1055 'ns' => $subjectTarget->getNamespace(),
1056 'title' => $this->getPrefixedText( $subjectTarget ),
1059 $this->getItemsFromApiResponse(
$result )
1064 $title = Title::newFromLinkTarget( $target );
1070 'rc_namespace' =>
$title->getNamespace(),
1071 'rc_title' =>
$title->getDBkey(),
1073 'rc_source' =>
'foo',
1075 'rc_cur_id' =>
$title->getArticleID(),
1077 'rc_user_text' =>
'ext>External User',
1079 'rc_comment_text' =>
'',
1080 'rc_comment_data' =>
null,
1081 'rc_this_oldid' =>
$title->getLatestRevID(),
1082 'rc_last_oldid' =>
$title->getLatestRevID(),
1085 'rc_patrolled' => 0,
1087 'rc_old_len' =>
$title->getLength(),
1088 'rc_new_len' =>
$title->getLength(),
1091 'rc_log_type' =>
null,
1092 'rc_log_action' =>
'',
1096 'prefixedDBkey' =>
$title->getPrefixedDBkey(),
1097 'lastTimestamp' => 0,
1098 'oldSize' =>
$title->getLength(),
1099 'newSize' =>
$title->getLength(),
1100 'pageStatus' =>
'changed'
1108 $subjectTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
1109 $talkTarget =
new TitleValue( 1,
'ApiQueryWatchlistIntegrationTestPage' );
1119 'Some Talk Page Content',
1130 $this->assertEquals(
1133 'type' =>
'external',
1134 'ns' => $subjectTarget->getNamespace(),
1135 'title' => $this->getPrefixedText( $subjectTarget ),
1138 $this->getItemsFromApiResponse(
$result )
1144 $subjectTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
1150 'target' => $categoryTarget,
1151 'content' =>
'Some Content',
1152 'summary' =>
'Create the category',
1155 'target' => $subjectTarget,
1156 'content' =>
'Some Content [[Category:ApiQueryWatchlistIntegrationTestCategory]]t',
1157 'summary' =>
'Create the page and add it to the category',
1161 $title = Title::newFromLinkTarget( $subjectTarget );
1164 $rc = RecentChange::newForCategorization(
1165 $revision->getTimestamp(),
1166 Title::newFromLinkTarget( $categoryTarget ),
1168 $revision->getComment(),
1181 $this->assertEquals(
1184 'type' =>
'categorize',
1185 'ns' => $categoryTarget->getNamespace(),
1186 'title' => $this->getPrefixedText( $categoryTarget ),
1189 $this->getItemsFromApiResponse(
$result )
1195 $target1 =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
1196 $target2 =
new TitleValue( 1,
'ApiQueryWatchlistIntegrationTestPage' );
1197 $target3 =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage2' );
1202 'target' => $target1,
1203 'content' =>
'Some Content',
1204 'summary' =>
'Create the page',
1207 'target' => $target2,
1208 'content' =>
'Some Talk Page Content',
1209 'summary' =>
'Create Talk page',
1212 'target' => $target3,
1213 'content' =>
'Some Other Content',
1214 'summary' =>
'Create the page',
1223 $this->assertEquals(
1227 'ns' => $target3->getNamespace(),
1228 'title' => $this->getPrefixedText( $target3 )
1232 'ns' => $target2->getNamespace(),
1233 'title' => $this->getPrefixedText( $target2 )
1237 'ns' => $target1->getNamespace(),
1238 'title' => $this->getPrefixedText( $target1 )
1241 $this->getItemsFromApiResponse( $resultWithoutLimit )
1243 $this->assertEquals(
1247 'ns' => $target3->getNamespace(),
1248 'title' => $this->getPrefixedText( $target3 )
1252 'ns' => $target2->getNamespace(),
1253 'title' => $this->getPrefixedText( $target2 )
1256 $this->getItemsFromApiResponse( $resultWithLimit )
1258 $this->assertArrayHasKey(
'continue', $resultWithLimit[0] );
1259 $this->assertArrayHasKey(
'wlcontinue', $resultWithLimit[0][
'continue'] );
1264 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
1269 'target' => $target,
1270 'content' =>
'Some Content',
1271 'summary' =>
'Create the page',
1274 'target' => $target,
1275 'content' =>
'Some Other Content',
1276 'summary' =>
'Change the content',
1285 $this->assertEquals(
1289 'ns' => $target->getNamespace(),
1290 'title' => $this->getPrefixedText( $target ),
1293 $this->getItemsFromApiResponse( $resultNoAllRev )
1295 $this->assertEquals(
1299 'ns' => $target->getNamespace(),
1300 'title' => $this->getPrefixedText( $target ),
1304 'ns' => $target->getNamespace(),
1305 'title' => $this->getPrefixedText( $target ),
1308 $this->getItemsFromApiResponse( $resultAllRev )
1314 $subjectTarget =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
1315 $talkTarget =
new TitleValue( 1,
'ApiQueryWatchlistIntegrationTestPage' );
1320 'target' => $subjectTarget,
1321 'content' =>
'Some Content',
1322 'summary' =>
'Create the page',
1325 'target' => $talkTarget,
1326 'content' =>
'Some Talk Page Content',
1327 'summary' =>
'Create Talk page',
1336 $this->assertEquals(
1340 'ns' => $talkTarget->getNamespace(),
1341 'title' => $this->getPrefixedText( $talkTarget )
1345 'ns' => $subjectTarget->getNamespace(),
1346 'title' => $this->getPrefixedText( $subjectTarget )
1349 $this->getItemsFromApiResponse( $resultDirOlder )
1351 $this->assertEquals(
1355 'ns' => $subjectTarget->getNamespace(),
1356 'title' => $this->getPrefixedText( $subjectTarget )
1360 'ns' => $talkTarget->getNamespace(),
1361 'title' => $this->getPrefixedText( $talkTarget )
1364 $this->getItemsFromApiResponse( $resultDirNewer )
1370 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
1380 'wlstart' =>
'20010115000000',
1382 'wlprop' =>
'title',
1385 'wlend' =>
'20010115000000',
1387 'wlprop' =>
'title',
1390 $this->assertEquals(
1394 'ns' => $target->getNamespace(),
1395 'title' => $this->getPrefixedText( $target ),
1398 $this->getItemsFromApiResponse( $resultStart )
1405 $target1 =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
1406 $target2 =
new TitleValue( 1,
'ApiQueryWatchlistIntegrationTestPage' );
1407 $target3 =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage2' );
1412 'target' => $target1,
1413 'content' =>
'Some Content',
1414 'summary' =>
'Create the page',
1417 'target' => $target2,
1418 'content' =>
'Some Talk Page Content',
1419 'summary' =>
'Create Talk page',
1422 'target' => $target3,
1423 'content' =>
'Some Other Content',
1424 'summary' =>
'Create the page',
1431 $this->assertArrayHasKey(
'continue', $firstResult[0] );
1432 $this->assertArrayHasKey(
'wlcontinue', $firstResult[0][
'continue'] );
1434 $continuationParam = $firstResult[0][
'continue'][
'wlcontinue'];
1437 [
'wlcontinue' => $continuationParam,
'wlprop' =>
'title' ]
1440 $this->assertEquals(
1444 'ns' => $target3->getNamespace(),
1445 'title' => $this->getPrefixedText( $target3 ),
1449 'ns' => $target2->getNamespace(),
1450 'title' => $this->getPrefixedText( $target2 ),
1453 $this->getItemsFromApiResponse( $firstResult )
1455 $this->assertEquals(
1459 'ns' => $target1->getNamespace(),
1460 'title' => $this->getPrefixedText( $target1 )
1463 $this->getItemsFromApiResponse( $continuedResult )
1468 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
1477 $otherUser->setOption(
'watchlisttoken',
'1234567890' );
1478 $otherUser->saveSettings();
1480 $this->
watchPages( $otherUser, [ $target ] );
1483 $this->assertEquals(
'1234567890', $reloadedUser->getOption(
'watchlisttoken' ) );
1486 'wlowner' => $otherUser->getName(),
1487 'wltoken' =>
'1234567890',
1488 'wlprop' =>
'title',
1491 $this->assertEquals(
1495 'ns' => $target->getNamespace(),
1496 'title' => $this->getPrefixedText( $target )
1499 $this->getItemsFromApiResponse(
$result )
1505 $otherUser->setOption(
'watchlisttoken',
'1234567890' );
1506 $otherUser->saveSettings();
1508 $this->setExpectedException( ApiUsageException::class,
'Incorrect watchlist token provided' );
1511 'wlowner' => $otherUser->getName(),
1512 'wltoken' =>
'wrong-token',
1517 $this->setExpectedException( ApiUsageException::class,
'Incorrect watchlist token provided' );
1521 'wltoken' =>
'some-token',
1527 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
1538 $this->assertArrayHasKey(
'query',
$result[0] );
1539 $this->assertArrayHasKey(
'pages',
$result[0][
'query'] );
1542 $pages = array_values(
$result[0][
'query'][
'pages'] );
1548 'ns' => $target->getNamespace(),
1549 'title' => $this->getPrefixedText( $target ),
1553 [
'ns',
'title',
'new' ]
1559 $target =
new TitleValue( 0,
'ApiQueryWatchlistIntegrationTestPage' );
1564 'target' => $target,
1565 'content' =>
'Some Content',
1566 'summary' =>
'Create the page',
1569 'target' => $target,
1570 'content' =>
'Some Other Content',
1571 'summary' =>
'Change the content',
1579 $this->assertArrayHasKey(
'query',
$result[0] );
1580 $this->assertArrayHasKey(
'pages',
$result[0][
'query'] );
1583 $pages = array_values(
$result[0][
'query'][
'pages'] );
1585 $this->assertCount( 1, $pages );
1586 $this->assertEquals( 0, $pages[0][
'ns'] );
1587 $this->assertEquals( $this->
getPrefixedText( $target ), $pages[0][
'title'] );
1589 $pages[0][
'revisions'],
1592 'comment' =>
'Create the page',
1593 'user' =>
$user->getName(),
1597 'comment' =>
'Change the content',
1598 'user' =>
$user->getName(),
1602 [
'comment',
'user',
'minor' ]
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
testExternalTypeParameters()
testUserIdPropParameter()
testCommentPropParameter()
setupPatrolledSpecificFixtures(User $user)
watchPages(User $user, array $targets)
testParsedCommentPropParameter()
testShowPatrolledParams()
assertArraySubsetsEqual(array $actualItems, array $expectedItems, array $keysUsedInValueComparison, array $requiredKeys=[])
Convenience method to assert that actual items array fetched from API is equal to the expected array,...
testOwnerAndTokenParams_wrongToken()
doPageEdits(User $user, array $editData)
Performs a batch of page edits as a specified user.
testLoginfoPropParameter()
cleanTestUsersWatchlist()
testListWatchlist_returnsWatchedItemsWithRCInfo()
testOwnerAndTokenParams_noWatchlistTokenSet()
testOwnerAndTokenParams()
testCategorizeTypeParameter()
doPatrolledPageEdit(User $user, LinkTarget $target, $content, $summary, User $patrollingUser)
doBotPageEdit(User $user, LinkTarget $target, $content, $summary)
deletePage(LinkTarget $target, $reason)
testPatrolPropParameter()
doMinorPageEdit(User $user, LinkTarget $target, $content, $summary)
testGeneratorWatchlistPropInfo_returnsWatchedPages()
__construct( $name=null, array $data=[], $dataName='')
getExternalRC(LinkTarget $target)
doAnonPageEdit(LinkTarget $target, $content, $summary)
getPrefixedText(LinkTarget $target)
createPageAndDeleteIt(LinkTarget $target)
doGeneratorWatchlistRequest(array $params=[])
testNewAndEditTypeParameters()
testTimestampPropParameter()
testGeneratorWatchlistPropRevisions_returnsWatchedItemsRevisions()
getItemsFromApiResponse(array $response)
doListWatchlistRequest(array $params=[], $user=null)
testNotificationTimestampPropParameter()
doPageEdit(User $user, LinkTarget $target, $content, $summary)
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null, $tokenType=null)
Does the API request and returns the result.
Utility class for creating new RC entries.
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target.
Represents a page (or page fragment) title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static newFromId( $id)
Static factory method for creation from a given user ID.
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 as
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
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. 'ImgAuthModifyHeaders':Executed just before a file is streamed to a user via img_auth.php, allowing headers to be modified beforehand. $title:LinkTarget object & $headers:HTTP headers(name=> value, names are case insensitive). Two headers get special handling:If-Modified-Since(value must be a valid HTTP date) and Range(must be of the form "bytes=(\d*-\d*)") will be honored when streaming the file. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUnknownUser':When a user doesn 't exist locally, this hook is called to give extensions an opportunity to auto-create it. If the auto-creation is successful, return false. $name:User name 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. '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 '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 '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 '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. '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 IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() '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 Sanitizer::validateEmail(), 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 '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:Array with elements of the form "language:title" in the order that they will be output. & $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. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED since 1.28! Use HtmlPageLinkRendererBegin instead. 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
namespace and then decline to actually register it file or subcat img or subcat $title
Allows to change the fields on the form that will be generated $name
this hook is for auditing only $response
return true to allow those checks to and false if checking is done & $user
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
$page->newPageUpdater($user) $updater