13 ->disableOriginalConstructor()
16 $mock->expects( $this->any() )
17 ->method(
'makeList' )
19 $this->isType(
'array' ),
20 $this->isType(
'int' )
22 ->will( $this->returnCallback(
function( $a, $conj ) {
23 $sqlConj = $conj ===
LIST_AND ?
' AND ' :
' OR ';
24 return join( $sqlConj, array_map(
function(
$s ) {
25 return '(' .
$s .
')';
30 $mock->expects( $this->any() )
31 ->method(
'addQuotes' )
32 ->will( $this->returnCallback(
function(
$value ) {
36 $mock->expects( $this->any() )
37 ->method(
'timestamp' )
38 ->will( $this->returnArgument( 0 ) );
40 $mock->expects( $this->any() )
42 ->willReturnCallback(
function( $a, $b ) {
55 ->disableOriginalConstructor()
57 $mock->expects( $this->any() )
58 ->method(
'getConnection' )
60 ->will( $this->returnValue( $mockDb ) );
70 $mock->expects( $this->any() )
72 ->will( $this->returnValue(
false ) );
73 $mock->expects( $this->any() )
75 ->will( $this->returnValue( $id ) );
85 $mock->expects( $this->any() )
86 ->method(
'isAllowed' )
87 ->will( $this->returnValue(
true ) );
88 $mock->expects( $this->any() )
89 ->method(
'isAllowedAny' )
90 ->will( $this->returnValue(
true ) );
91 $mock->expects( $this->any() )
92 ->method(
'useRCPatrol' )
93 ->will( $this->returnValue(
true ) );
105 $mock->expects( $this->any() )
106 ->method(
'isAllowed' )
107 ->will( $this->returnCallback(
function( $action )
use ( $notAllowedAction ) {
108 return $action !== $notAllowedAction;
110 $mock->expects( $this->any() )
111 ->method(
'isAllowedAny' )
112 ->will( $this->returnCallback(
function()
use ( $notAllowedAction ) {
113 $actions = func_get_args();
114 return !in_array( $notAllowedAction, $actions );
127 $mock->expects( $this->any() )
128 ->method(
'isAllowed' )
129 ->will( $this->returnValue(
true ) );
130 $mock->expects( $this->any() )
131 ->method(
'isAllowedAny' )
132 ->will( $this->returnValue(
true ) );
134 $mock->expects( $this->any() )
135 ->method(
'useRCPatrol' )
136 ->will( $this->returnValue(
false ) );
137 $mock->expects( $this->any() )
138 ->method(
'useNPPatrol' )
139 ->will( $this->returnValue(
false ) );
146 $mock->expects( $this->any() )
148 ->will( $this->returnValue(
true ) );
153 $fakeRow =
new stdClass();
154 foreach ( $rowValues
as $valueName =>
$value ) {
155 $fakeRow->$valueName =
$value;
162 $mockDb->expects( $this->once() )
165 [
'recentchanges',
'watchlist',
'page' ],
173 'wl_notificationtimestamp',
180 '(rc_this_oldid=page_latest) OR (rc_type=3)',
182 $this->isType(
'string' ),
188 'wl_namespace=rc_namespace',
198 ->will( $this->returnValue( [
202 'rc_title' =>
'Foo1',
203 'rc_timestamp' =>
'20151212010101',
206 'wl_notificationtimestamp' =>
'20151212010101',
211 'rc_title' =>
'Foo2',
212 'rc_timestamp' =>
'20151212010102',
215 'wl_notificationtimestamp' => null,
222 $items = $queryService->getWatchedItemsWithRecentChangeInfo(
$user );
224 $this->assertInternalType(
'array', $items );
225 $this->assertCount( 2, $items );
227 foreach ( $items
as list( $watchedItem, $recentChangeInfo ) ) {
229 $this->assertInternalType(
'array', $recentChangeInfo );
240 'rc_title' =>
'Foo1',
241 'rc_timestamp' =>
'20151212010101',
256 'rc_title' =>
'Foo2',
257 'rc_timestamp' =>
'20151212010102',
269 [
'rc_type',
'rc_minor',
'rc_bot' ],
293 [
'rc_patrolled',
'rc_log_type' ],
299 [
'rc_old_len',
'rc_new_len' ],
305 [
'rc_logid',
'rc_log_type',
'rc_log_action',
'rc_params' ],
310 [
'namespaceIds' => [ 0, 1 ] ],
312 [
'wl_namespace' => [ 0, 1 ] ],
316 [
'namespaceIds' => [ 0,
"1; DROP TABLE watchlist;\n--" ] ],
318 [
'wl_namespace' => [ 0, 1 ] ],
331 [
'ORDER BY' => [
'rc_timestamp DESC',
'rc_id DESC' ] ]
337 [
'ORDER BY' => [
'rc_timestamp',
'rc_id' ] ]
342 [
"rc_timestamp <= '20151212010101'" ],
343 [
'ORDER BY' => [
'rc_timestamp DESC',
'rc_id DESC' ] ]
348 [
"rc_timestamp >= '20151212010101'" ],
349 [
'ORDER BY' => [
'rc_timestamp DESC',
'rc_id DESC' ] ]
354 'start' =>
'20151212020101',
355 'end' =>
'20151212010101'
358 [
"rc_timestamp <= '20151212020101'",
"rc_timestamp >= '20151212010101'" ],
359 [
'ORDER BY' => [
'rc_timestamp DESC',
'rc_id DESC' ] ]
364 [
"rc_timestamp >= '20151212010101'" ],
365 [
'ORDER BY' => [
'rc_timestamp',
'rc_id' ] ]
370 [
"rc_timestamp <= '20151212010101'" ],
371 [
'ORDER BY' => [
'rc_timestamp',
'rc_id' ] ]
376 'start' =>
'20151212010101',
377 'end' =>
'20151212020101'
380 [
"rc_timestamp >= '20151212010101'",
"rc_timestamp <= '20151212020101'" ],
381 [
'ORDER BY' => [
'rc_timestamp',
'rc_id' ] ]
390 [
'limit' =>
"10; DROP TABLE watchlist;\n--" ],
434 [
'rc_patrolled != 0' ],
440 [
'rc_patrolled = 0' ],
446 [
'rc_timestamp >= wl_notificationtimestamp' ],
452 [
'wl_notificationtimestamp IS NULL OR rc_timestamp < wl_notificationtimestamp' ],
456 [
'onlyByUser' =>
'SomeOtherUser' ],
458 [
'rc_user_text' =>
'SomeOtherUser' ],
462 [
'notByUser' =>
'SomeOtherUser' ],
464 [
"rc_user_text != 'SomeOtherUser'" ],
471 "(rc_timestamp < '20151212010101') OR ((rc_timestamp = '20151212010101') AND (rc_id <= 123))"
473 [
'ORDER BY' => [
'rc_timestamp DESC',
'rc_id DESC' ] ],
479 "(rc_timestamp > '20151212010101') OR ((rc_timestamp = '20151212010101') AND (rc_id >= 123))"
481 [
'ORDER BY' => [
'rc_timestamp',
'rc_id' ] ],
485 'startFrom' => [
'20151212010101',
"123; DROP TABLE watchlist;\n--" ],
490 "(rc_timestamp < '20151212010101') OR ((rc_timestamp = '20151212010101') AND (rc_id <= 123))"
492 [
'ORDER BY' => [
'rc_timestamp DESC',
'rc_id DESC' ] ],
502 array $expectedExtraFields,
503 array $expectedExtraConds,
504 array $expectedDbOptions
506 $expectedFields = array_merge(
514 'wl_notificationtimestamp',
522 $expectedConds = array_merge(
523 [
'wl_user' => 1,
'(rc_this_oldid=page_latest) OR (rc_type=3)', ],
528 $mockDb->expects( $this->once() )
531 [
'recentchanges',
'watchlist',
'page' ],
534 $this->isType(
'string' ),
540 'wl_namespace=rc_namespace',
550 ->will( $this->returnValue( [] ) );
555 $items = $queryService->getWatchedItemsWithRecentChangeInfo(
$user, $options );
557 $this->assertEmpty( $items );
574 $mockDb->expects( $this->once() )
577 [
'recentchanges',
'watchlist',
'page' ],
578 $this->isType(
'array' ),
579 [
'wl_user' => 1,
'(rc_this_oldid=page_latest) OR (rc_type=3)' ],
580 $this->isType(
'string' ),
581 $this->isType(
'array' ),
582 $this->isType(
'array' )
584 ->will( $this->returnValue( [] ) );
589 $items = $queryService->getWatchedItemsWithRecentChangeInfo(
591 [
'filters' => [ $filtersOption ] ]
594 $this->assertEmpty( $items );
602 [
"rc_timestamp > ''" ],
607 [
"rc_timestamp <= '20151212010101'" ],
612 [
"rc_timestamp >= '20151212010101'" ],
628 array $expectedExtraConds
630 $commonConds = [
'wl_user' => 1,
'(rc_this_oldid=page_latest) OR (rc_type=3)' ];
631 $conds = array_merge( $commonConds, $expectedExtraConds );
634 $mockDb->expects( $this->once() )
637 [
'recentchanges',
'watchlist',
'page' ],
638 $this->isType(
'array' ),
640 $this->isType(
'string' ),
641 $this->isType(
'array' ),
642 $this->isType(
'array' )
644 ->will( $this->returnValue( [] ) );
645 $mockDb->expects( $this->any() )
646 ->method(
'getType' )
647 ->will( $this->returnValue( $dbType ) );
652 $items = $queryService->getWatchedItemsWithRecentChangeInfo(
$user, $options );
654 $this->assertEmpty( $items );
671 '(rc_type != ' .
RC_LOG .
') OR (' .
680 '(rc_type != ' .
RC_LOG .
') OR (' .
686 [
'onlyByUser' =>
'SomeOtherUser' ],
689 'rc_user_text' =>
'SomeOtherUser',
696 [
'onlyByUser' =>
'SomeOtherUser' ],
699 'rc_user_text' =>
'SomeOtherUser',
702 '(rc_type != ' .
RC_LOG .
') OR (' .
708 [
'onlyByUser' =>
'SomeOtherUser' ],
711 'rc_user_text' =>
'SomeOtherUser',
714 '(rc_type != ' .
RC_LOG .
') OR (' .
728 array $expectedExtraConds
730 $commonConds = [
'wl_user' => 1,
'(rc_this_oldid=page_latest) OR (rc_type=3)' ];
731 $conds = array_merge( $commonConds, $expectedExtraConds );
734 $mockDb->expects( $this->once() )
737 [
'recentchanges',
'watchlist',
'page' ],
738 $this->isType(
'array' ),
740 $this->isType(
'string' ),
741 $this->isType(
'array' ),
742 $this->isType(
'array' )
744 ->will( $this->returnValue( [] ) );
749 $items = $queryService->getWatchedItemsWithRecentChangeInfo(
$user, $options );
751 $this->assertEmpty( $items );
756 $mockDb->expects( $this->once() )
759 [
'recentchanges',
'watchlist' ],
767 'wl_notificationtimestamp',
774 $this->isType(
'string' ),
780 'wl_namespace=rc_namespace',
786 ->will( $this->returnValue( [] ) );
791 $items = $queryService->getWatchedItemsWithRecentChangeInfo(
$user, [
'allRevisions' =>
true ] );
793 $this->assertEmpty( $items );
799 [
'rcTypes' => [ 1337 ] ],
800 'Bad value for parameter $options[\'rcTypes\']',
803 [
'rcTypes' => [
'edit' ] ],
804 'Bad value for parameter $options[\'rcTypes\']',
807 [
'rcTypes' => [
RC_EDIT, 1337 ] ],
808 'Bad value for parameter $options[\'rcTypes\']',
812 'Bad value for parameter $options[\'dir\']',
815 [
'start' =>
'20151212010101' ],
816 'Bad value for parameter $options[\'dir\']: must be provided',
819 [
'end' =>
'20151212010101' ],
820 'Bad value for parameter $options[\'dir\']: must be provided',
823 [
'startFrom' => [
'20151212010101', 123 ] ],
824 'Bad value for parameter $options[\'dir\']: must be provided',
828 'Bad value for parameter $options[\'startFrom\']: must be a two-element array',
832 'Bad value for parameter $options[\'startFrom\']: must be a two-element array',
837 'startFrom' => [
'20151212010101', 123,
'foo' ]
839 'Bad value for parameter $options[\'startFrom\']: must be a two-element array',
843 'Bad value for parameter $options[\'watchlistOwnerToken\']',
846 [
'watchlistOwner' =>
'Other User',
'watchlistOwnerToken' =>
'some-token' ],
847 'Bad value for parameter $options[\'watchlistOwner\']',
857 $expectedInExceptionMessage
860 $mockDb->expects( $this->never() )
867 $queryService->getWatchedItemsWithRecentChangeInfo(
$user, $options );
872 $mockDb->expects( $this->once() )
875 [
'recentchanges',
'watchlist',
'page' ],
883 'wl_notificationtimestamp',
886 [
'wl_user' => 1,
'(rc_this_oldid=page_latest) OR (rc_type=3)' ],
887 $this->isType(
'string' ),
893 'wl_namespace=rc_namespace',
903 ->will( $this->returnValue( [] ) );
908 $items = $queryService->getWatchedItemsWithRecentChangeInfo(
910 [
'usedInGenerator' =>
true ]
913 $this->assertEmpty( $items );
918 $mockDb->expects( $this->once() )
921 [
'recentchanges',
'watchlist' ],
929 'wl_notificationtimestamp',
933 $this->isType(
'string' ),
939 'wl_namespace=rc_namespace',
945 ->will( $this->returnValue( [] ) );
950 $items = $queryService->getWatchedItemsWithRecentChangeInfo(
952 [
'usedInGenerator' =>
true,
'allRevisions' =>
true, ]
955 $this->assertEmpty( $items );
960 $mockDb->expects( $this->once() )
963 $this->isType(
'array' ),
964 $this->isType(
'array' ),
967 '(rc_this_oldid=page_latest) OR (rc_type=3)',
969 $this->isType(
'string' ),
970 $this->isType(
'array' ),
971 $this->isType(
'array' )
973 ->will( $this->returnValue( [] ) );
978 $otherUser->expects( $this->once() )
979 ->method(
'getOption' )
980 ->with(
'watchlisttoken' )
981 ->willReturn(
'0123456789abcdef' );
983 $items = $queryService->getWatchedItemsWithRecentChangeInfo(
985 [
'watchlistOwner' => $otherUser,
'watchlistOwnerToken' =>
'0123456789abcdef' ]
988 $this->assertEmpty( $items );
1003 $mockDb->expects( $this->never() )
1009 $otherUser->expects( $this->once() )
1010 ->method(
'getOption' )
1011 ->with(
'watchlisttoken' )
1012 ->willReturn(
'0123456789abcdef' );
1015 $queryService->getWatchedItemsWithRecentChangeInfo(
1017 [
'watchlistOwner' => $otherUser,
'watchlistOwnerToken' => $token ]
1023 $mockDb->expects( $this->once() )
1024 ->method(
'select' )
1027 [
'wl_namespace',
'wl_title',
'wl_notificationtimestamp' ],
1030 ->will( $this->returnValue( [
1032 'wl_namespace' => 0,
1033 'wl_title' =>
'Foo1',
1034 'wl_notificationtimestamp' =>
'20151212010101',
1037 'wl_namespace' => 1,
1038 'wl_title' =>
'Foo2',
1039 'wl_notificationtimestamp' => null,
1046 $items = $queryService->getWatchedItemsForUser(
$user );
1048 $this->assertInternalType(
'array', $items );
1049 $this->assertCount( 2, $items );
1051 $this->assertEquals(
1055 $this->assertEquals(
1064 [
'namespaceIds' => [ 0, 1 ], ],
1065 [
'wl_namespace' => [ 0, 1 ], ],
1071 [
'ORDER BY' => [
'wl_namespace ASC',
'wl_title ASC' ] ]
1075 'namespaceIds' => [ 0 ],
1078 [
'wl_namespace' => [ 0 ], ],
1079 [
'ORDER BY' =>
'wl_title ASC' ]
1088 'namespaceIds' => [ 0,
"1; DROP TABLE watchlist;\n--" ],
1089 'limit' =>
"10; DROP TABLE watchlist;\n--",
1091 [
'wl_namespace' => [ 0, 1 ], ],
1096 [
'wl_notificationtimestamp IS NOT NULL' ],
1101 [
'wl_notificationtimestamp IS NULL' ],
1107 [
'ORDER BY' => [
'wl_namespace DESC',
'wl_title DESC' ] ]
1111 'namespaceIds' => [ 0 ],
1114 [
'wl_namespace' => [ 0 ], ],
1115 [
'ORDER BY' =>
'wl_title DESC' ]
1125 array $expectedConds,
1126 array $expectedDbOptions
1131 $expectedConds = array_merge( [
'wl_user' => 1 ], $expectedConds );
1132 $mockDb->expects( $this->once() )
1133 ->method(
'select' )
1136 [
'wl_namespace',
'wl_title',
'wl_notificationtimestamp' ],
1138 $this->isType(
'string' ),
1141 ->will( $this->returnValue( [] ) );
1145 $items = $queryService->getWatchedItemsForUser(
$user, $options );
1146 $this->assertEmpty( $items );
1156 [
"(wl_namespace > 0) OR ((wl_namespace = 0) AND (wl_title >= 'SomeDbKey'))", ],
1157 [
'ORDER BY' => [
'wl_namespace ASC',
'wl_title ASC' ] ]
1164 [
"(wl_namespace < 0) OR ((wl_namespace = 0) AND (wl_title <= 'SomeDbKey'))", ],
1165 [
'ORDER BY' => [
'wl_namespace DESC',
'wl_title DESC' ] ]
1172 [
"(wl_namespace < 0) OR ((wl_namespace = 0) AND (wl_title <= 'SomeDbKey'))", ],
1173 [
'ORDER BY' => [
'wl_namespace ASC',
'wl_title ASC' ] ]
1180 [
"(wl_namespace > 0) OR ((wl_namespace = 0) AND (wl_title >= 'SomeDbKey'))", ],
1181 [
'ORDER BY' => [
'wl_namespace DESC',
'wl_title DESC' ] ]
1185 'from' =>
new TitleValue( 0,
'AnotherDbKey' ),
1186 'until' =>
new TitleValue( 0,
'SomeOtherDbKey' ),
1187 'startFrom' =>
new TitleValue( 0,
'SomeDbKey' ),
1191 "(wl_namespace > 0) OR ((wl_namespace = 0) AND (wl_title >= 'AnotherDbKey'))",
1192 "(wl_namespace < 0) OR ((wl_namespace = 0) AND (wl_title <= 'SomeOtherDbKey'))",
1193 "(wl_namespace > 0) OR ((wl_namespace = 0) AND (wl_title >= 'SomeDbKey'))",
1195 [
'ORDER BY' => [
'wl_namespace ASC',
'wl_title ASC' ] ]
1199 'from' =>
new TitleValue( 0,
'SomeOtherDbKey' ),
1200 'until' =>
new TitleValue( 0,
'AnotherDbKey' ),
1201 'startFrom' =>
new TitleValue( 0,
'SomeDbKey' ),
1205 "(wl_namespace < 0) OR ((wl_namespace = 0) AND (wl_title <= 'SomeOtherDbKey'))",
1206 "(wl_namespace > 0) OR ((wl_namespace = 0) AND (wl_title >= 'AnotherDbKey'))",
1207 "(wl_namespace < 0) OR ((wl_namespace = 0) AND (wl_title <= 'SomeDbKey'))",
1209 [
'ORDER BY' => [
'wl_namespace DESC',
'wl_title DESC' ] ]
1219 array $expectedConds,
1220 array $expectedDbOptions
1224 $expectedConds = array_merge( [
'wl_user' => 1 ], $expectedConds );
1227 $mockDb->expects( $this->any() )
1228 ->method(
'addQuotes' )
1229 ->will( $this->returnCallback(
function(
$value ) {
1232 $mockDb->expects( $this->any() )
1233 ->method(
'makeList' )
1235 $this->isType(
'array' ),
1236 $this->isType(
'int' )
1238 ->will( $this->returnCallback(
function( $a, $conj ) {
1239 $sqlConj = $conj ===
LIST_AND ?
' AND ' :
' OR ';
1240 return join( $sqlConj, array_map(
function(
$s ) {
1241 return '(' .
$s .
')';
1245 $mockDb->expects( $this->once() )
1246 ->method(
'select' )
1249 [
'wl_namespace',
'wl_title',
'wl_notificationtimestamp' ],
1251 $this->isType(
'string' ),
1254 ->will( $this->returnValue( [] ) );
1258 $items = $queryService->getWatchedItemsForUser(
$user, $options );
1259 $this->assertEmpty( $items );
1265 [
'sort' =>
'foo' ],
1266 'Bad value for parameter $options[\'sort\']'
1269 [
'filter' =>
'foo' ],
1270 'Bad value for parameter $options[\'filter\']'
1273 [
'from' =>
new TitleValue( 0,
'SomeDbKey' ), ],
1274 'Bad value for parameter $options[\'sort\']: must be provided'
1277 [
'until' =>
new TitleValue( 0,
'SomeDbKey' ), ],
1278 'Bad value for parameter $options[\'sort\']: must be provided'
1281 [
'startFrom' =>
new TitleValue( 0,
'SomeDbKey' ), ],
1282 'Bad value for parameter $options[\'sort\']: must be provided'
1292 $expectedInExceptionMessage
1303 $mockDb->expects( $this->never() )
1308 $items = $queryService->getWatchedItemsForUser( $this->
getMockAnonUser() );
1309 $this->assertEmpty( $items );
testGetWatchedItemsWithRecentChangeInfo()
testGetWatchedItemsWithRecentChangeInfo_optionsAndEmptyResult(array $options, array $expectedExtraFields, array $expectedExtraConds, array $expectedDbOptions)
getWatchedItemsWithRecentChangeInfoOptionsProvider
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
the array() calling protocol came about after MediaWiki 1.4rc1.
testGetWatchedItemsForUser_optionsAndEmptyResult(array $options, array $expectedConds, array $expectedDbOptions)
provideGetWatchedItemsForUserOptions
testGetWatchedItemsWithRecentChangeInfo_usedInGeneratorAllRevisionsOptions()
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
mysqlIndexOptimizationProvider()
Represents a page (or page fragment) title within MediaWiki.
provideGetWatchedItemsForUserOptions()
getWatchedItemsWithRecentChangeInfoInvalidOptionsProvider()
const INCLUDE_PATROL_INFO
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 so they can t rely on Unix and must forbid reads to even standard directories like tmp lest users read each others files We cannot assume that the user has the ability to install or run any programs not written as web accessible PHP scripts Since anything that works on cheap shared hosting will work if you have shell or root access MediaWiki s design is based around catering to the lowest common denominator Although we support higher end setups as the way many things work by default is tailored toward shared hosting These defaults are unconventional from the point of view of and they certainly aren t ideal for someone who s installing MediaWiki as MediaWiki does not conform to normal Unix filesystem layout Hopefully we ll offer direct support for standard layouts in the but for now *any change to the location of files is unsupported *Moving things and leaving symlinks will *probably *not break anything
getWatchedItemsForUserInvalidOptionsProvider()
getMockNonAnonUserWithIdAndRestrictedPermissions($id, $notAllowedAction)
filterPatrolledOptionProvider()
testGetWatchedItemsWithRecentChangeInfo_userPermissionRelatedExtraChecks(array $options, $notAllowedAction, array $expectedExtraConds)
userPermissionRelatedExtraChecksProvider
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
testGetWatchedItemsForUser_invalidOptionThrowsException(array $options, $expectedInExceptionMessage)
getWatchedItemsForUserInvalidOptionsProvider
provideGetWatchedItemsForUser_fromUntilStartFromOptions()
testGetWatchedItemsWithRecentChangeInfo_invalidOptions(array $options, $expectedInExceptionMessage)
getWatchedItemsWithRecentChangeInfoInvalidOptionsProvider
const FILTER_NOT_PATROLLED
testGetWatchedItemsForUser_userNotAllowedToViewWatchlist()
testGetWatchedItemsForUser()
Representation of a pair of user and title for watchlist entries.
invalidWatchlistTokenProvider()
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
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 local account $user
testGetWatchedItemsWithRecentChangeInfo_allRevisionsOptionAndEmptyResult()
testGetWatchedItemsWithRecentChangeInfo_watchlistOwnerOptionAndEmptyResult()
getMockNonAnonUserWithId($id)
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
testGetWatchedItemsWithRecentChangeInfo_mysqlIndexOptimization($dbType, array $options, array $expectedExtraConds)
mysqlIndexOptimizationProvider
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
getMockUnrestrictedNonAnonUserWithId($id)
testGetWatchedItemsWithRecentChangeInfo_filterPatrolledAndUserWithNoPatrolRights($filtersOption)
filterPatrolledOptionProvider
getWatchedItemsWithRecentChangeInfoOptionsProvider()
testGetWatchedItemsForUser_fromUntilStartFromOptions(array $options, array $expectedConds, array $expectedDbOptions)
provideGetWatchedItemsForUser_fromUntilStartFromOptions
testGetWatchedItemsWithRecentChangeInfo_watchlistOwnerAndInvalidToken($token)
invalidWatchlistTokenProvider
getFakeRow(array $rowValues)
userPermissionRelatedExtraChecksProvider()
testGetWatchedItemsWithRecentChangeInfo_usedInGeneratorOptionAndEmptyResult()
getMockNonAnonUserWithIdAndNoPatrolRights($id)
getMockLoadBalancer($mockDb)