From: Leszek Manicki Date: Wed, 20 Apr 2016 09:57:02 +0000 (+0200) Subject: Add missing tests for some edge cases in WatchedItem::getNotificationTimestamp X-Git-Tag: 1.31.0-rc.0~7217^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=a2fafaf7669617c622603222008d68041133e675;p=lhc%2Fweb%2Fwiklou.git Add missing tests for some edge cases in WatchedItem::getNotificationTimestamp Change-Id: I18dd5976cc0f44f9dca8ee420ace226e49ab6288 --- 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() ); + } + }