Merge "phan: Don't hardcode 'php7.0' binary"
[lhc/web/wiklou.git] / tests / phpunit / includes / WatchedItemIntegrationTest.php
index e536205..65a8c86 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+use MediaWiki\MediaWikiServices;
 
 /**
  * @author Addshore
@@ -13,6 +14,13 @@ class WatchedItemIntegrationTest extends MediaWikiTestCase {
                parent::setUp();
                self::$users['WatchedItemIntegrationTestUser']
                        = new TestUser( 'WatchedItemIntegrationTestUser' );
+
+               $this->hideDeprecated( 'WatchedItem::fromUserTitle' );
+               $this->hideDeprecated( 'WatchedItem::addWatch' );
+               $this->hideDeprecated( 'WatchedItem::removeWatch' );
+               $this->hideDeprecated( 'WatchedItem::isWatched' );
+               $this->hideDeprecated( 'WatchedItem::duplicateEntries' );
+               $this->hideDeprecated( 'WatchedItem::batchAddWatch' );
        }
 
        private function getUser() {
@@ -20,6 +28,7 @@ class WatchedItemIntegrationTest extends MediaWikiTestCase {
        }
 
        public function testWatchAndUnWatchItem() {
+
                $user = $this->getUser();
                $title = Title::newFromText( 'WatchedItemIntegrationTestPage' );
                // Cleanup after previous tests
@@ -54,7 +63,9 @@ class WatchedItemIntegrationTest extends MediaWikiTestCase {
                        WatchedItem::fromUserTitle( $user, $title )->getNotificationTimestamp()
                );
 
-               WatchedItem::fromUserTitle( $user, $title )->resetNotificationTimestamp();
+               MediaWikiServices::getInstance()->getWatchedItemStore()->resetNotificationTimestamp(
+                       $user, $title
+               );
                $this->assertNull( WatchedItem::fromUserTitle( $user, $title )->getNotificationTimestamp() );
        }
 
@@ -98,7 +109,9 @@ class WatchedItemIntegrationTest extends MediaWikiTestCase {
                $user = $this->getUser();
                $title = Title::newFromText( 'WatchedItemIntegrationTestPage' );
                WatchedItem::fromUserTitle( $user, $title )->addWatch();
-               WatchedItem::fromUserTitle( $user, $title )->resetNotificationTimestamp();
+               MediaWikiServices::getInstance()->getWatchedItemStore()->resetNotificationTimestamp(
+                       $user, $title
+               );
 
                $this->assertEquals(
                        null,