MediaWiki  1.27.2
WatchedItemStoreUnitTest Class Reference
Inheritance diagram for WatchedItemStoreUnitTest:
Collaboration diagram for WatchedItemStoreUnitTest:

Public Member Functions

 provideDbTypes ()
 
 provideIntWithDbUnsafeVersion ()
 
 provideLinkTargetPairs ()
 
 testAddWatch_anonymousUser ()
 
 testAddWatch_nonAnonymousUser ()
 
 testAddWatchBatchForUser_anonymousUsersAreSkipped ()
 
 testAddWatchBatchForUser_nonAnonymousUser ()
 
 testAddWatchBatchForUser_readOnlyDBReturnsFalse ()
 
 testAddWatchBatchReturnsTrue_whenGivenEmptyList ()
 
 testCountUnreadNotifications ()
 
 testCountUnreadNotifications_withUnreadLimit_overLimit ($limit)
 provideIntWithDbUnsafeVersion More...
 
 testCountUnreadNotifications_withUnreadLimit_underLimit ($limit)
 provideIntWithDbUnsafeVersion More...
 
 testCountVisitingWatchers ()
 
 testCountVisitingWatchersMultiple ()
 
 testCountVisitingWatchersMultiple_withMinimumWatchers ($minWatchers)
 provideIntWithDbUnsafeVersion More...
 
 testCountVisitingWatchersMultiple_withMissingTargets ()
 
 testCountWatchedItems ()
 
 testCountWatchers ()
 
 testCountWatchersMultiple ()
 
 testCountWatchersMultiple_withMinimumWatchers ($minWatchers)
 provideIntWithDbUnsafeVersion More...
 
 testDuplicateAllAssociatedEntries_nothingToDuplicate ()
 
 testDuplicateAllAssociatedEntries_somethingToDuplicate (LinkTarget $oldTarget, LinkTarget $newTarget)
 provideLinkTargetPairs More...
 
 testDuplicateEntry_nothingToDuplicate ()
 
 testDuplicateEntry_somethingToDuplicate ()
 
 testGetDefaultInstance ()
 
 testGetNotificationTimestampsBatch ()
 
 testGetNotificationTimestampsBatch_allItemsCached ()
 
 testGetNotificationTimestampsBatch_anonymousUser ()
 
 testGetNotificationTimestampsBatch_cachedItem ()
 
 testGetNotificationTimestampsBatch_notWatchedTarget ()
 
 testGetWatchedItem_anonymousUser ()
 
 testGetWatchedItem_cachedItem ()
 
 testGetWatchedItem_existingItem ()
 
 testGetWatchedItem_noItem ()
 
 testGetWatchedItemsForUser ()
 
 testGetWatchedItemsForUser_badSortOptionThrowsException ()
 
 testGetWatchedItemsForUser_optionsAndEmptyResult ($forWrite, $dbType)
 provideDbTypes More...
 
 testIsWatchedItem_anonymousUser ()
 
 testIsWatchedItem_existingItem ()
 
 testIsWatchedItem_noItem ()
 
 testLoadWatchedItem_anonymousUser ()
 
 testLoadWatchedItem_existingItem ()
 
 testLoadWatchedItem_noItem ()
 
 testOverrideDefaultInstance ()
 
 testRemoveWatch_anonymousUser ()
 
 testRemoveWatch_existingItem ()
 
 testRemoveWatch_noItem ()
 
 testResetNotificationTimestamp_anonymousUser ()
 
 testResetNotificationTimestamp_futureNotificationTimestampForced ()
 
 testResetNotificationTimestamp_futureNotificationTimestampNotForced ()
 
 testResetNotificationTimestamp_item ()
 
 testResetNotificationTimestamp_noItem ()
 
 testResetNotificationTimestamp_noItemForced ()
 
 testResetNotificationTimestamp_notWatchedPageForced ()
 
 testResetNotificationTimestamp_oldidSpecifiedLatestRevisionForced ()
 
 testResetNotificationTimestamp_oldidSpecifiedNotLatestRevisionForced ()
 
 testUpdateNotificationTimestamp_clearsCachedItems ()
 
 testUpdateNotificationTimestamp_noWatchers ()
 
 testUpdateNotificationTimestamp_watchersExist ()
 

Private Member Functions

 getAnonUser ()
 
 getFakeRow (array $rowValues)
 
 getMockCache ()
 
 getMockDb ()
 
 getMockLoadBalancer ($mockDb, $expectedConnectionType=null, $readOnlyReason=false)
 
 getMockNonAnonUserWithId ($id)
 
 getMockTitle ($text, $ns=0)
 
 newWatchedItemStore (LoadBalancer $loadBalancer, HashBagOStuff $cache)
 
 verifyCallbackJob ($callback, LinkTarget $expectedTitle, $expectedUserId, callable $notificationTimestampCondition)
 

Detailed Description

Author
Addshore

WatchedItemStore

Definition at line 9 of file WatchedItemStoreUnitTest.php.

Member Function Documentation

WatchedItemStoreUnitTest::getAnonUser ( )
private
Returns
User

Definition at line 78 of file WatchedItemStoreUnitTest.php.

References User\newFromName().

Referenced by testAddWatch_anonymousUser().

WatchedItemStoreUnitTest::getMockCache ( )
private
Returns
PHPUnit_Framework_MockObject_MockObject|HashBagOStuff

Definition at line 48 of file WatchedItemStoreUnitTest.php.

References class.

Referenced by testAddWatch_anonymousUser(), testAddWatch_nonAnonymousUser(), testAddWatchBatchForUser_anonymousUsersAreSkipped(), testAddWatchBatchForUser_nonAnonymousUser(), testAddWatchBatchForUser_readOnlyDBReturnsFalse(), testAddWatchBatchReturnsTrue_whenGivenEmptyList(), testCountUnreadNotifications(), testCountUnreadNotifications_withUnreadLimit_overLimit(), testCountUnreadNotifications_withUnreadLimit_underLimit(), testCountVisitingWatchers(), testCountVisitingWatchersMultiple(), testCountVisitingWatchersMultiple_withMinimumWatchers(), testCountVisitingWatchersMultiple_withMissingTargets(), testCountWatchedItems(), testCountWatchers(), testCountWatchersMultiple(), testCountWatchersMultiple_withMinimumWatchers(), testDuplicateAllAssociatedEntries_nothingToDuplicate(), testDuplicateAllAssociatedEntries_somethingToDuplicate(), testDuplicateEntry_nothingToDuplicate(), testDuplicateEntry_somethingToDuplicate(), testGetNotificationTimestampsBatch(), testGetNotificationTimestampsBatch_allItemsCached(), testGetNotificationTimestampsBatch_anonymousUser(), testGetNotificationTimestampsBatch_cachedItem(), testGetNotificationTimestampsBatch_notWatchedTarget(), testGetWatchedItem_anonymousUser(), testGetWatchedItem_cachedItem(), testGetWatchedItem_existingItem(), testGetWatchedItem_noItem(), testGetWatchedItemsForUser(), testGetWatchedItemsForUser_badSortOptionThrowsException(), testGetWatchedItemsForUser_optionsAndEmptyResult(), testIsWatchedItem_anonymousUser(), testIsWatchedItem_existingItem(), testIsWatchedItem_noItem(), testLoadWatchedItem_anonymousUser(), testLoadWatchedItem_existingItem(), testLoadWatchedItem_noItem(), testRemoveWatch_anonymousUser(), testRemoveWatch_existingItem(), testRemoveWatch_noItem(), testResetNotificationTimestamp_anonymousUser(), testResetNotificationTimestamp_futureNotificationTimestampForced(), testResetNotificationTimestamp_futureNotificationTimestampNotForced(), testResetNotificationTimestamp_item(), testResetNotificationTimestamp_noItem(), testResetNotificationTimestamp_noItemForced(), testResetNotificationTimestamp_notWatchedPageForced(), testResetNotificationTimestamp_oldidSpecifiedLatestRevisionForced(), testResetNotificationTimestamp_oldidSpecifiedNotLatestRevisionForced(), testUpdateNotificationTimestamp_clearsCachedItems(), testUpdateNotificationTimestamp_noWatchers(), and testUpdateNotificationTimestamp_watchersExist().

WatchedItemStoreUnitTest::getMockDb ( )
private
Returns
PHPUnit_Framework_MockObject_MockObject|IDatabase

Definition at line 14 of file WatchedItemStoreUnitTest.php.

References class.

Referenced by testAddWatch_anonymousUser(), testAddWatch_nonAnonymousUser(), testAddWatchBatchForUser_anonymousUsersAreSkipped(), testAddWatchBatchForUser_nonAnonymousUser(), testAddWatchBatchForUser_readOnlyDBReturnsFalse(), testAddWatchBatchReturnsTrue_whenGivenEmptyList(), testCountUnreadNotifications(), testCountUnreadNotifications_withUnreadLimit_overLimit(), testCountUnreadNotifications_withUnreadLimit_underLimit(), testCountVisitingWatchers(), testCountVisitingWatchersMultiple(), testCountVisitingWatchersMultiple_withMinimumWatchers(), testCountVisitingWatchersMultiple_withMissingTargets(), testCountWatchedItems(), testCountWatchers(), testCountWatchersMultiple(), testCountWatchersMultiple_withMinimumWatchers(), testDuplicateAllAssociatedEntries_nothingToDuplicate(), testDuplicateAllAssociatedEntries_somethingToDuplicate(), testDuplicateEntry_nothingToDuplicate(), testDuplicateEntry_somethingToDuplicate(), testGetNotificationTimestampsBatch(), testGetNotificationTimestampsBatch_allItemsCached(), testGetNotificationTimestampsBatch_anonymousUser(), testGetNotificationTimestampsBatch_cachedItem(), testGetNotificationTimestampsBatch_notWatchedTarget(), testGetWatchedItem_anonymousUser(), testGetWatchedItem_cachedItem(), testGetWatchedItem_existingItem(), testGetWatchedItem_noItem(), testGetWatchedItemsForUser(), testGetWatchedItemsForUser_badSortOptionThrowsException(), testGetWatchedItemsForUser_optionsAndEmptyResult(), testIsWatchedItem_anonymousUser(), testIsWatchedItem_existingItem(), testIsWatchedItem_noItem(), testLoadWatchedItem_anonymousUser(), testLoadWatchedItem_existingItem(), testLoadWatchedItem_noItem(), testRemoveWatch_anonymousUser(), testRemoveWatch_existingItem(), testRemoveWatch_noItem(), testResetNotificationTimestamp_anonymousUser(), testResetNotificationTimestamp_futureNotificationTimestampForced(), testResetNotificationTimestamp_futureNotificationTimestampNotForced(), testResetNotificationTimestamp_item(), testResetNotificationTimestamp_noItem(), testResetNotificationTimestamp_noItemForced(), testResetNotificationTimestamp_notWatchedPageForced(), testResetNotificationTimestamp_oldidSpecifiedLatestRevisionForced(), testResetNotificationTimestamp_oldidSpecifiedNotLatestRevisionForced(), testUpdateNotificationTimestamp_clearsCachedItems(), testUpdateNotificationTimestamp_noWatchers(), and testUpdateNotificationTimestamp_watchersExist().

WatchedItemStoreUnitTest::getMockLoadBalancer (   $mockDb,
  $expectedConnectionType = null,
  $readOnlyReason = false 
)
private
Returns
PHPUnit_Framework_MockObject_MockObject|LoadBalancer

Definition at line 21 of file WatchedItemStoreUnitTest.php.

References class.

Referenced by testAddWatch_anonymousUser(), testAddWatch_nonAnonymousUser(), testAddWatchBatchForUser_anonymousUsersAreSkipped(), testAddWatchBatchForUser_nonAnonymousUser(), testAddWatchBatchForUser_readOnlyDBReturnsFalse(), testAddWatchBatchReturnsTrue_whenGivenEmptyList(), testCountUnreadNotifications(), testCountUnreadNotifications_withUnreadLimit_overLimit(), testCountUnreadNotifications_withUnreadLimit_underLimit(), testCountVisitingWatchers(), testCountVisitingWatchersMultiple(), testCountVisitingWatchersMultiple_withMinimumWatchers(), testCountVisitingWatchersMultiple_withMissingTargets(), testCountWatchedItems(), testCountWatchers(), testCountWatchersMultiple(), testCountWatchersMultiple_withMinimumWatchers(), testDuplicateAllAssociatedEntries_nothingToDuplicate(), testDuplicateAllAssociatedEntries_somethingToDuplicate(), testDuplicateEntry_nothingToDuplicate(), testDuplicateEntry_somethingToDuplicate(), testGetNotificationTimestampsBatch(), testGetNotificationTimestampsBatch_allItemsCached(), testGetNotificationTimestampsBatch_anonymousUser(), testGetNotificationTimestampsBatch_cachedItem(), testGetNotificationTimestampsBatch_notWatchedTarget(), testGetWatchedItem_anonymousUser(), testGetWatchedItem_cachedItem(), testGetWatchedItem_existingItem(), testGetWatchedItem_noItem(), testGetWatchedItemsForUser(), testGetWatchedItemsForUser_badSortOptionThrowsException(), testGetWatchedItemsForUser_optionsAndEmptyResult(), testIsWatchedItem_anonymousUser(), testIsWatchedItem_existingItem(), testIsWatchedItem_noItem(), testLoadWatchedItem_anonymousUser(), testLoadWatchedItem_existingItem(), testLoadWatchedItem_noItem(), testRemoveWatch_anonymousUser(), testRemoveWatch_existingItem(), testRemoveWatch_noItem(), testResetNotificationTimestamp_anonymousUser(), testResetNotificationTimestamp_futureNotificationTimestampForced(), testResetNotificationTimestamp_futureNotificationTimestampNotForced(), testResetNotificationTimestamp_item(), testResetNotificationTimestamp_noItem(), testResetNotificationTimestamp_noItemForced(), testResetNotificationTimestamp_notWatchedPageForced(), testResetNotificationTimestamp_oldidSpecifiedLatestRevisionForced(), testResetNotificationTimestamp_oldidSpecifiedNotLatestRevisionForced(), testUpdateNotificationTimestamp_clearsCachedItems(), testUpdateNotificationTimestamp_noWatchers(), and testUpdateNotificationTimestamp_watchersExist().

WatchedItemStoreUnitTest::newWatchedItemStore ( LoadBalancer  $loadBalancer,
HashBagOStuff  $cache 
)
private

Definition at line 90 of file WatchedItemStoreUnitTest.php.

Referenced by testAddWatch_anonymousUser(), testAddWatch_nonAnonymousUser(), testAddWatchBatchForUser_anonymousUsersAreSkipped(), testAddWatchBatchForUser_nonAnonymousUser(), testAddWatchBatchForUser_readOnlyDBReturnsFalse(), testAddWatchBatchReturnsTrue_whenGivenEmptyList(), testCountUnreadNotifications(), testCountUnreadNotifications_withUnreadLimit_overLimit(), testCountUnreadNotifications_withUnreadLimit_underLimit(), testCountVisitingWatchers(), testCountVisitingWatchersMultiple(), testCountVisitingWatchersMultiple_withMinimumWatchers(), testCountVisitingWatchersMultiple_withMissingTargets(), testCountWatchedItems(), testCountWatchers(), testCountWatchersMultiple(), testCountWatchersMultiple_withMinimumWatchers(), testDuplicateAllAssociatedEntries_nothingToDuplicate(), testDuplicateAllAssociatedEntries_somethingToDuplicate(), testDuplicateEntry_nothingToDuplicate(), testDuplicateEntry_somethingToDuplicate(), testGetNotificationTimestampsBatch(), testGetNotificationTimestampsBatch_allItemsCached(), testGetNotificationTimestampsBatch_anonymousUser(), testGetNotificationTimestampsBatch_cachedItem(), testGetNotificationTimestampsBatch_notWatchedTarget(), testGetWatchedItem_anonymousUser(), testGetWatchedItem_cachedItem(), testGetWatchedItem_existingItem(), testGetWatchedItem_noItem(), testGetWatchedItemsForUser(), testGetWatchedItemsForUser_badSortOptionThrowsException(), testGetWatchedItemsForUser_optionsAndEmptyResult(), testIsWatchedItem_anonymousUser(), testIsWatchedItem_existingItem(), testIsWatchedItem_noItem(), testLoadWatchedItem_anonymousUser(), testLoadWatchedItem_existingItem(), testLoadWatchedItem_noItem(), testRemoveWatch_anonymousUser(), testRemoveWatch_existingItem(), testRemoveWatch_noItem(), testResetNotificationTimestamp_anonymousUser(), testResetNotificationTimestamp_futureNotificationTimestampForced(), testResetNotificationTimestamp_futureNotificationTimestampNotForced(), testResetNotificationTimestamp_item(), testResetNotificationTimestamp_noItem(), testResetNotificationTimestamp_noItemForced(), testResetNotificationTimestamp_notWatchedPageForced(), testResetNotificationTimestamp_oldidSpecifiedLatestRevisionForced(), testResetNotificationTimestamp_oldidSpecifiedNotLatestRevisionForced(), testUpdateNotificationTimestamp_clearsCachedItems(), testUpdateNotificationTimestamp_noWatchers(), and testUpdateNotificationTimestamp_watchersExist().

WatchedItemStoreUnitTest::provideDbTypes ( )

Definition at line 1439 of file WatchedItemStoreUnitTest.php.

References DB_MASTER, and DB_SLAVE.

WatchedItemStoreUnitTest::provideIntWithDbUnsafeVersion ( )

Definition at line 228 of file WatchedItemStoreUnitTest.php.

WatchedItemStoreUnitTest::provideLinkTargetPairs ( )

Definition at line 817 of file WatchedItemStoreUnitTest.php.

References Title\newFromText().

WatchedItemStoreUnitTest::testAddWatch_anonymousUser ( )
WatchedItemStoreUnitTest::testAddWatch_nonAnonymousUser ( )
WatchedItemStoreUnitTest::testAddWatchBatchForUser_anonymousUsersAreSkipped ( )
WatchedItemStoreUnitTest::testAddWatchBatchForUser_nonAnonymousUser ( )
WatchedItemStoreUnitTest::testAddWatchBatchForUser_readOnlyDBReturnsFalse ( )
WatchedItemStoreUnitTest::testAddWatchBatchReturnsTrue_whenGivenEmptyList ( )
WatchedItemStoreUnitTest::testCountUnreadNotifications ( )
WatchedItemStoreUnitTest::testCountUnreadNotifications_withUnreadLimit_overLimit (   $limit)

provideIntWithDbUnsafeVersion

Definition at line 612 of file WatchedItemStoreUnitTest.php.

References $limit, $user, getMockCache(), getMockDb(), getMockLoadBalancer(), getMockNonAnonUserWithId(), and newWatchedItemStore().

WatchedItemStoreUnitTest::testCountUnreadNotifications_withUnreadLimit_underLimit (   $limit)

provideIntWithDbUnsafeVersion

Definition at line 649 of file WatchedItemStoreUnitTest.php.

References $limit, $user, getMockCache(), getMockDb(), getMockLoadBalancer(), getMockNonAnonUserWithId(), and newWatchedItemStore().

WatchedItemStoreUnitTest::testCountVisitingWatchers ( )
WatchedItemStoreUnitTest::testCountVisitingWatchersMultiple ( )
WatchedItemStoreUnitTest::testCountVisitingWatchersMultiple_withMinimumWatchers (   $minWatchers)

provideIntWithDbUnsafeVersion

Definition at line 532 of file WatchedItemStoreUnitTest.php.

References getMockCache(), getMockDb(), getMockLoadBalancer(), and newWatchedItemStore().

WatchedItemStoreUnitTest::testCountVisitingWatchersMultiple_withMissingTargets ( )
WatchedItemStoreUnitTest::testCountWatchedItems ( )
WatchedItemStoreUnitTest::testCountWatchers ( )
WatchedItemStoreUnitTest::testCountWatchersMultiple ( )
WatchedItemStoreUnitTest::testCountWatchersMultiple_withMinimumWatchers (   $minWatchers)

provideIntWithDbUnsafeVersion

Definition at line 238 of file WatchedItemStoreUnitTest.php.

References getFakeRow(), getMockCache(), getMockDb(), getMockLoadBalancer(), and newWatchedItemStore().

WatchedItemStoreUnitTest::testDuplicateAllAssociatedEntries_nothingToDuplicate ( )
WatchedItemStoreUnitTest::testDuplicateAllAssociatedEntries_somethingToDuplicate ( LinkTarget  $oldTarget,
LinkTarget  $newTarget 
)
WatchedItemStoreUnitTest::testDuplicateEntry_nothingToDuplicate ( )
WatchedItemStoreUnitTest::testDuplicateEntry_somethingToDuplicate ( )
WatchedItemStoreUnitTest::testGetDefaultInstance ( )
WatchedItemStoreUnitTest::testGetNotificationTimestampsBatch ( )
WatchedItemStoreUnitTest::testGetNotificationTimestampsBatch_allItemsCached ( )
WatchedItemStoreUnitTest::testGetNotificationTimestampsBatch_anonymousUser ( )
WatchedItemStoreUnitTest::testGetNotificationTimestampsBatch_cachedItem ( )
WatchedItemStoreUnitTest::testGetNotificationTimestampsBatch_notWatchedTarget ( )
WatchedItemStoreUnitTest::testGetWatchedItem_anonymousUser ( )
WatchedItemStoreUnitTest::testGetWatchedItem_cachedItem ( )
WatchedItemStoreUnitTest::testGetWatchedItem_existingItem ( )
WatchedItemStoreUnitTest::testGetWatchedItem_noItem ( )
WatchedItemStoreUnitTest::testGetWatchedItemsForUser ( )
WatchedItemStoreUnitTest::testGetWatchedItemsForUser_badSortOptionThrowsException ( )
WatchedItemStoreUnitTest::testGetWatchedItemsForUser_optionsAndEmptyResult (   $forWrite,
  $dbType 
)
WatchedItemStoreUnitTest::testIsWatchedItem_anonymousUser ( )
WatchedItemStoreUnitTest::testIsWatchedItem_existingItem ( )
WatchedItemStoreUnitTest::testIsWatchedItem_noItem ( )
WatchedItemStoreUnitTest::testLoadWatchedItem_anonymousUser ( )
WatchedItemStoreUnitTest::testLoadWatchedItem_existingItem ( )
WatchedItemStoreUnitTest::testLoadWatchedItem_noItem ( )
WatchedItemStoreUnitTest::testOverrideDefaultInstance ( )
WatchedItemStoreUnitTest::testRemoveWatch_anonymousUser ( )
WatchedItemStoreUnitTest::testRemoveWatch_existingItem ( )
WatchedItemStoreUnitTest::testRemoveWatch_noItem ( )
WatchedItemStoreUnitTest::testResetNotificationTimestamp_anonymousUser ( )
WatchedItemStoreUnitTest::testResetNotificationTimestamp_futureNotificationTimestampForced ( )
WatchedItemStoreUnitTest::testResetNotificationTimestamp_futureNotificationTimestampNotForced ( )
WatchedItemStoreUnitTest::testResetNotificationTimestamp_item ( )
WatchedItemStoreUnitTest::testResetNotificationTimestamp_noItem ( )
WatchedItemStoreUnitTest::testResetNotificationTimestamp_noItemForced ( )
WatchedItemStoreUnitTest::testResetNotificationTimestamp_notWatchedPageForced ( )
WatchedItemStoreUnitTest::testResetNotificationTimestamp_oldidSpecifiedLatestRevisionForced ( )
WatchedItemStoreUnitTest::testResetNotificationTimestamp_oldidSpecifiedNotLatestRevisionForced ( )
WatchedItemStoreUnitTest::testUpdateNotificationTimestamp_clearsCachedItems ( )
WatchedItemStoreUnitTest::testUpdateNotificationTimestamp_noWatchers ( )
WatchedItemStoreUnitTest::testUpdateNotificationTimestamp_watchersExist ( )

The documentation for this class was generated from the following file: