+class WatchedItemUnitTest extends MediaWikiTestCase {
+
+ /**
+ * @param int $id
+ *
+ * @return PHPUnit_Framework_MockObject_MockObject|User
+ */
+ private function getMockUser( $id ) {
+ $user = $this->getMock( User::class );
+ $user->expects( $this->any() )
+ ->method( 'getId' )
+ ->will( $this->returnValue( $id ) );
+ $user->expects( $this->any() )
+ ->method( 'isAllowed' )
+ ->will( $this->returnValue( true ) );
+ return $user;
+ }