16 self::$users[
'ApiQueryWatchlistRawIntegrationTestUser']
18 self::$users[
'ApiQueryWatchlistRawIntegrationTestUser2']
23 return self::$users[
'ApiQueryWatchlistRawIntegrationTestUser']->getUser();
27 return self::$users[
'ApiQueryWatchlistRawIntegrationTestUser2']->getUser();
31 return MediaWikiServices::getInstance()->getWatchedItemStore();
36 [
'action' =>
'query',
'list' =>
'watchlistraw' ],
43 [
'action' =>
'query',
'generator' =>
'watchlistraw' ],
56 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage' )
61 $this->assertArrayHasKey(
'watchlistraw', $result[0] );
67 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage',
75 $target =
new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage' );
81 $store->updateNotificationTimestamp(
93 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage',
94 'changed' =>
'2015-12-12T01:01:01Z',
105 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage' ),
106 new TitleValue( 1,
'ApiQueryWatchlistRawIntegrationTestPage' ),
115 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage',
123 $subjectTarget =
new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage' );
124 $talkTarget =
new TitleValue( 1,
'ApiQueryWatchlistRawIntegrationTestPage' );
133 $store->updateNotificationTimestamp(
140 [
'wrprop' =>
'changed',
'wrshow' => WatchedItemQueryService::FILTER_CHANGED ]
143 [
'wrprop' =>
'changed',
'wrshow' => WatchedItemQueryService::FILTER_NOT_CHANGED ]
150 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage',
151 'changed' =>
'2015-12-12T01:01:01Z',
161 'title' =>
'Talk:ApiQueryWatchlistRawIntegrationTestPage',
172 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
173 new TitleValue( 1,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
174 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage2' ),
184 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage1',
188 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage2',
192 'title' =>
'Talk:ApiQueryWatchlistRawIntegrationTestPage1',
201 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage1',
205 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage2',
211 $this->assertArrayNotHasKey(
'continue', $resultWithoutLimit[0] );
212 $this->assertArrayHasKey(
'continue', $resultWithLimit[0] );
213 $this->assertArrayHasKey(
'wrcontinue', $resultWithLimit[0][
'continue'] );
220 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
221 new TitleValue( 1,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
222 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage2' ),
232 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage1',
236 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage2',
240 'title' =>
'Talk:ApiQueryWatchlistRawIntegrationTestPage1',
250 'title' =>
'Talk:ApiQueryWatchlistRawIntegrationTestPage1',
254 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage2',
258 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage1',
269 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
270 new TitleValue( 1,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
271 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage2' ),
287 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
288 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage2' ),
289 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage3' ),
293 'wrfromtitle' =>
'ApiQueryWatchlistRawIntegrationTestPage2',
300 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage2',
304 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage3',
315 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
316 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage2' ),
317 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage3' ),
321 'wrtotitle' =>
'ApiQueryWatchlistRawIntegrationTestPage2',
328 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage1',
332 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage2',
343 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
344 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage2' ),
345 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage3' ),
349 $continuationParam = $firstResult[0][
'continue'][
'wrcontinue'];
351 $this->assertEquals(
'0|ApiQueryWatchlistRawIntegrationTestPage3', $continuationParam );
359 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage3',
370 'wrfromtitle' =>
'ApiQueryWatchlistRawIntegrationTestPage1',
371 'wrtotitle' =>
'ApiQueryWatchlistRawIntegrationTestPage2',
374 [
'ns' => 0,
'title' =>
'ApiQueryWatchlistRawIntegrationTestPage1' ],
375 [
'ns' => 0,
'title' =>
'ApiQueryWatchlistRawIntegrationTestPage2' ],
380 'wrfromtitle' =>
'ApiQueryWatchlistRawIntegrationTestPage1',
381 'wrcontinue' =>
'0|ApiQueryWatchlistRawIntegrationTestPage3',
384 [
'ns' => 0,
'title' =>
'ApiQueryWatchlistRawIntegrationTestPage3' ],
389 'wrtotitle' =>
'ApiQueryWatchlistRawIntegrationTestPage3',
390 'wrcontinue' =>
'0|ApiQueryWatchlistRawIntegrationTestPage2',
393 [
'ns' => 0,
'title' =>
'ApiQueryWatchlistRawIntegrationTestPage2' ],
394 [
'ns' => 0,
'title' =>
'ApiQueryWatchlistRawIntegrationTestPage3' ],
399 'wrfromtitle' =>
'ApiQueryWatchlistRawIntegrationTestPage1',
400 'wrtotitle' =>
'ApiQueryWatchlistRawIntegrationTestPage3',
401 'wrcontinue' =>
'0|ApiQueryWatchlistRawIntegrationTestPage3',
404 [
'ns' => 0,
'title' =>
'ApiQueryWatchlistRawIntegrationTestPage3' ],
417 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
418 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage2' ),
419 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage3' ),
431 'wrfromtitle' =>
'ApiQueryWatchlistRawIntegrationTestPage2',
432 'wrtotitle' =>
'ApiQueryWatchlistRawIntegrationTestPage1',
437 'wrfromtitle' =>
'ApiQueryWatchlistRawIntegrationTestPage1',
438 'wrtotitle' =>
'ApiQueryWatchlistRawIntegrationTestPage2',
439 'wrdir' =>
'descending',
444 'wrtotitle' =>
'ApiQueryWatchlistRawIntegrationTestPage1',
445 'wrcontinue' =>
'0|ApiQueryWatchlistRawIntegrationTestPage2',
458 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
459 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage2' ),
465 $this->assertArrayNotHasKey(
'continue', $result[0] );
470 $otherUser->setOption(
'watchlisttoken',
'1234567890' );
471 $otherUser->saveSettings();
474 $store->addWatchBatchForUser( $otherUser, [
475 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
476 new TitleValue( 1,
'ApiQueryWatchlistRawIntegrationTestPage1' ),
479 ObjectCache::getMainWANInstance()->clearProcessCache();
481 'wrowner' => $otherUser->getName(),
482 'wrtoken' =>
'1234567890',
489 'title' =>
'ApiQueryWatchlistRawIntegrationTestPage1',
493 'title' =>
'Talk:ApiQueryWatchlistRawIntegrationTestPage1',
502 $otherUser->setOption(
'watchlisttoken',
'1234567890' );
503 $otherUser->saveSettings();
505 $this->setExpectedException( ApiUsageException::class,
'Incorrect watchlist token provided' );
508 'wrowner' => $otherUser->getName(),
509 'wrtoken' =>
'wrong-token',
514 $this->setExpectedException( ApiUsageException::class,
'Incorrect watchlist token provided' );
518 'wrtoken' =>
'some-watchlist-token',
526 new TitleValue( 0,
'ApiQueryWatchlistRawIntegrationTestPage' )
531 $this->assertArrayHasKey(
'query', $result[0] );
532 $this->assertArrayHasKey(
'pages', $result[0][
'query'] );
533 $this->assertCount( 1, $result[0][
'query'][
'pages'] );
536 $item = array_values( $result[0][
'query'][
'pages'] )[0];
538 $this->assertEquals( 0, $item[
'ns'] );
539 $this->assertEquals(
'ApiQueryWatchlistRawIntegrationTestPage', $item[
'title'] );
testFromTitleToTitleContinueSelfContradictoryCombo(array $params)
fromTitleToTitleContinueSelfContradictoryComboProvider
testOwnerAndTokenParams_userHasNoWatchlistToken()
fromTitleToTitleContinueSelfContradictoryComboProvider()
testFromTitleToTitleContinueCombo(array $params, array $expectedItems)
fromTitleToTitleContinueComboProvider
testAscendingIsDefaultOrder()
getItemsFromApiResponse(array $response)
fromTitleToTitleContinueComboProvider()
testGeneratorWatchlistRawPropInfo_returnsWatchedItems()
doListWatchlistRawRequest(array $params=[])
testOwnerAndTokenParams()
testOwnerAndTokenParams_wrongToken()
doGeneratorWatchlistRawRequest(array $params=[])
testListWatchlistRaw_returnsWatchedItems()
testPropChanged_addsNotificationTimestamp()
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null, $tokenType=null)
Does the API request and returns the result.
Represents a page (or page fragment) title within MediaWiki.
this hook is for auditing only $response