41 $watchedItemStore->addWatch( $user,
new TitleValue( 0,
'A' ) );
42 $watchedItemStore->addWatch( $user,
new TitleValue( 1,
'A' ) );
43 $watchedItemStore->addWatch( $user,
new TitleValue( 0,
'B' ) );
44 $watchedItemStore->addWatch( $user,
new TitleValue( 1,
'B' ) );
46 $maxId = $watchedItemStore->getMaxId();
48 $watchedItemStore->addWatch( $user,
new TitleValue( 0,
'C' ) );
49 $watchedItemStore->addWatch( $user,
new TitleValue( 1,
'C' ) );
53 JobQueueGroup::singleton()->push(
57 'userId' => $user->getId(),
58 'maxWatchlistId' => $maxId,
63 $this->assertEquals( 1, JobQueueGroup::singleton()->getQueueSizes()[
'clearUserWatchlist'] );
64 $this->assertEquals( 6, $watchedItemStore->countWatchedItems( $user ) );
66 $this->assertEquals( 1, JobQueueGroup::singleton()->getQueueSizes()[
'clearUserWatchlist'] );
67 $this->assertEquals( 4, $watchedItemStore->countWatchedItems( $user ) );
69 $this->assertEquals( 1, JobQueueGroup::singleton()->getQueueSizes()[
'clearUserWatchlist'] );
70 $this->assertEquals( 2, $watchedItemStore->countWatchedItems( $user ) );
72 $this->assertEquals( 0, JobQueueGroup::singleton()->getQueueSizes()[
'clearUserWatchlist'] );
73 $this->assertEquals( 2, $watchedItemStore->countWatchedItems( $user ) );
75 $this->assertTrue( $watchedItemStore->isWatched( $user,
new TitleValue( 0,
'C' ) ) );
76 $this->assertTrue( $watchedItemStore->isWatched( $user,
new TitleValue( 1,
'C' ) ) );