mediawiki-extensions-Echo/tests/phpunit
Roan Kattouw 0807c3c5ad NotifUser: Refactor getNotificationCount() and friends, add caching for global counts
Previously, getNotificationCount() only looked at local notifications,
and foreign notifications were added in separately by getMessageCount()
and getAlertCount(). This didn't make any sense and resulted in
counter-intuitive things like I4d49b543.

Instead, add a $global flag to getNotificationCount(). If $global=false,
the local count is returned as before, but if $global=true, the
global count (=local+foreign) is returned. If $global is omitted,
the user's cross-wiki notification preference determines which is returned.

Update getLastUnreadNotificationCount() in the same way, since it had
the same issues.

Also add caching for global counts and timestamps, using a global
memc key.

Bug: T133623
Change-Id: If78bfc710acd91a075771b565cc99f4c302a104d
2016-05-02 16:16:57 -07:00
..
api Remove param index 2016-04-21 13:33:15 +02:00
cache Migrate LocalCache from MapCacheLRU to HashBagOStuff 2015-11-03 06:49:50 +00:00
controller BREAKING CHANGE: Change $wgEchoDefaultNotificationTypes to be logical 2016-04-22 19:08:12 -07:00
formatters Get rid of old flyout formatter code 2016-02-05 06:56:15 +00:00
gateway Let EchoUserNotificationGateway return a different notification count 2016-03-22 14:22:15 +01:00
iterator Update formatting 2015-10-03 23:28:54 -04:00
maintenance build: Enable phpcs rule 'MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment' and make pass 2015-10-29 13:06:14 +01:00
mapper Also support continuation requests for $unreadFirst 2015-12-10 17:33:32 +01:00
model Update formatting 2015-10-03 23:28:54 -04:00
revision_txt Add test case to demonstrate T68512 is fixed 2015-07-06 17:31:08 -07:00
AttributeManagerTest.php Display special: Add which section (curr. Alert v. Msg.) each type's in 2016-04-28 20:33:52 +00:00
ContainmentSetTest.php Update formatting 2015-10-03 23:28:54 -04:00
DiffParserTest.php build: Enable phpcs rule 'PSR2.Methods.MethodDeclaration.StaticBeforeVisibility' and make pass 2015-10-29 13:06:43 +01:00
DiscussionParserTest.php Recreate test users for every test 2016-04-12 11:42:22 -04:00
EchoDbFactoryTest.php Update formatting 2015-10-03 23:28:54 -04:00
EmailFormatterTest.php Fix visibility of setUp methods in tests 2015-12-14 11:02:34 +01:00
NotifUserTest.php NotifUser: Refactor getNotificationCount() and friends, add caching for global counts 2016-05-02 16:16:57 -07:00
TalkPageFunctionalTest.php Fix visibility of setUp methods in tests 2015-12-14 11:02:34 +01:00
UserLocatorTest.php Update formatting 2015-10-03 23:28:54 -04:00