jenkins-bot has submitted this change and it was merged.
Change subject: Add missing tests for some edge cases in
WatchedItem::getNotificationTimestamp
......................................................................
Add missing tests for some edge cases in WatchedItem::getNotificationTimestamp
Change-Id: I18dd5976cc0f44f9dca8ee420ace226e49ab6288
---
M tests/phpunit/includes/WatchedItemIntegrationTest.php
1 file changed, 11 insertions(+), 1 deletion(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/phpunit/includes/WatchedItemIntegrationTest.php
b/tests/phpunit/includes/WatchedItemIntegrationTest.php
index 20fcedb..e536205 100644
--- a/tests/phpunit/includes/WatchedItemIntegrationTest.php
+++ b/tests/phpunit/includes/WatchedItemIntegrationTest.php
@@ -105,7 +105,7 @@
WatchedItem::fromUserTitle( $user, $title
)->getNotificationTimestamp()
);
$user->mRights = [];
- $this->assertFalse( WatchedItem::fromUserTitle( $user, $title
)->isWatched() );
+ $this->assertFalse( WatchedItem::fromUserTitle( $user, $title
)->getNotificationTimestamp() );
}
public function testRemoveWatch_falseOnNotAllowed() {
@@ -120,4 +120,14 @@
$this->assertTrue( WatchedItem::fromUserTitle( $user, $title
)->removeWatch() );
}
+ public function testGetNotificationTimestamp_falseOnNotWatched() {
+ $user = $this->getUser();
+ $title = Title::newFromText( 'WatchedItemIntegrationTestPage' );
+
+ WatchedItem::fromUserTitle( $user, $title )->removeWatch();
+ $this->assertFalse( WatchedItem::fromUserTitle( $user, $title
)->isWatched() );
+
+ $this->assertFalse( WatchedItem::fromUserTitle( $user, $title
)->getNotificationTimestamp() );
+ }
+
}
--
To view, visit https://gerrit.wikimedia.org/r/284436
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I18dd5976cc0f44f9dca8ee420ace226e49ab6288
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: WMDE-leszek <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: WMDE-leszek <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits