From a2fafaf7669617c622603222008d68041133e675 Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Wed, 20 Apr 2016 11:57:02 +0200 Subject: [PATCH] Add missing tests for some edge cases in WatchedItem::getNotificationTimestamp Change-Id: I18dd5976cc0f44f9dca8ee420ace226e49ab6288 --- .../phpunit/includes/WatchedItemIntegrationTest.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/WatchedItemIntegrationTest.php b/tests/phpunit/includes/WatchedItemIntegrationTest.php index 20fcedb9a1..e5362053fd 100644 --- a/tests/phpunit/includes/WatchedItemIntegrationTest.php +++ b/tests/phpunit/includes/WatchedItemIntegrationTest.php @@ -105,7 +105,7 @@ class WatchedItemIntegrationTest extends MediaWikiTestCase { 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 @@ class WatchedItemIntegrationTest extends MediaWikiTestCase { $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() ); + } + } -- 2.20.1