Merge "Add 3D filetype for STL files"
[lhc/web/wiklou.git] / tests / phpunit / includes / WatchedItemQueryServiceUnitTest.php
index 93687df..872c580 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use Wikimedia\TestingAccessWrapper;
+
 /**
  * @covers WatchedItemQueryService
  */
@@ -66,7 +68,7 @@ class WatchedItemQueryServiceUnitTest extends PHPUnit_Framework_TestCase {
         * @return PHPUnit_Framework_MockObject_MockObject|User
         */
        private function getMockNonAnonUserWithId( $id ) {
-               $mock = $this->getMock( User::class );
+               $mock = $this->getMockBuilder( User::class )->getMock();
                $mock->expects( $this->any() )
                        ->method( 'isAnon' )
                        ->will( $this->returnValue( false ) );
@@ -142,7 +144,7 @@ class WatchedItemQueryServiceUnitTest extends PHPUnit_Framework_TestCase {
        }
 
        private function getMockAnonUser() {
-               $mock = $this->getMock( User::class );
+               $mock = $this->getMockBuilder( User::class )->getMock();
                $mock->expects( $this->any() )
                        ->method( 'isAnon' )
                        ->will( $this->returnValue( true ) );
@@ -1233,7 +1235,7 @@ class WatchedItemQueryServiceUnitTest extends PHPUnit_Framework_TestCase {
                        ->with( 'watchlisttoken' )
                        ->willReturn( '0123456789abcdef' );
 
-               $this->setExpectedException( UsageException::class, 'Incorrect watchlist token provided' );
+               $this->setExpectedException( ApiUsageException::class, 'Incorrect watchlist token provided' );
                $queryService->getWatchedItemsWithRecentChangeInfo(
                        $user,
                        [ 'watchlistOwner' => $otherUser, 'watchlistOwnerToken' => $token ]