<?php
+use Wikimedia\TestingAccessWrapper;
+
/**
* @covers WatchedItemQueryService
*/
* @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 ) );
}
private function getMockAnonUser() {
- $mock = $this->getMock( User::class );
+ $mock = $this->getMockBuilder( User::class )->getMock();
$mock->expects( $this->any() )
->method( 'isAnon' )
->will( $this->returnValue( true ) );
->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 ]