X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fphpunit%2Fincludes%2FWatchedItemStoreIntegrationTest.php;h=61b62aa66bb0df516947986fcb12b5adfd2a2bb6;hb=6d9704caefde82e494a8eeffe7abee5978f9f7b1;hp=f34af6113d00e00162757d622e6074c3ab69974b;hpb=2ff4b95bd19fe3a272d55ad53690e6ddfbcf067f;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/WatchedItemStoreIntegrationTest.php b/tests/phpunit/includes/WatchedItemStoreIntegrationTest.php index f34af6113d..61b62aa66b 100644 --- a/tests/phpunit/includes/WatchedItemStoreIntegrationTest.php +++ b/tests/phpunit/includes/WatchedItemStoreIntegrationTest.php @@ -106,7 +106,7 @@ class WatchedItemStoreIntegrationTest extends MediaWikiTestCase { ); } - public function testUpdateAndResetNotificationTimestamp() { + public function testUpdateResetAndSetNotificationTimestamp() { $user = $this->getUser(); $otherUser = ( new TestUser( 'WatchedItemStoreIntegrationTestUser_otherUser' ) )->getUser(); $title = Title::newFromText( 'WatchedItemStoreIntegrationTestPage' ); @@ -172,6 +172,24 @@ class WatchedItemStoreIntegrationTest extends MediaWikiTestCase { [ [ $title, '20150202020202' ] ], $initialVisitingWatchers + 1 ) ); + + // setNotificationTimestampsForUser specifying a title + $this->assertTrue( + $store->setNotificationTimestampsForUser( $user, '20200202020202', [ $title ] ) + ); + $this->assertEquals( + '20200202020202', + $store->getWatchedItem( $user, $title )->getNotificationTimestamp() + ); + + // setNotificationTimestampsForUser not specifying a title + $this->assertTrue( + $store->setNotificationTimestampsForUser( $user, '20210202020202' ) + ); + $this->assertEquals( + '20210202020202', + $store->getWatchedItem( $user, $title )->getNotificationTimestamp() + ); } public function testDuplicateAllAssociatedEntries() {