Fix deprecated getMock warningtags/v11.0RC2
public function setUp() { | public function setUp() { | ||||
parent::setUp(); | parent::setUp(); | ||||
$this->request = $this->getMock('\\OCP\\IRequest'); | |||||
$this->jobList = $this->getMock('\\OCP\\BackgroundJob\\IJobList'); | |||||
$this->secureRandom = $this->getMock('\\OCP\\Security\\ISecureRandom'); | |||||
$this->config = $this->getMock('\\OCP\\IConfig'); | |||||
$this->timeFactory = $this->getMock('\\OCP\\AppFramework\\Utility\\ITimeFactory'); | |||||
$this->l10n = $this->getMock('\\OCP\\IL10N'); | |||||
$this->request = $this->getMockBuilder('\\OCP\\IRequest')->getMock(); | |||||
$this->jobList = $this->getMockBuilder('\\OCP\\BackgroundJob\\IJobList')->getMock(); | |||||
$this->secureRandom = $this->getMockBuilder('\\OCP\\Security\\ISecureRandom')->getMock(); | |||||
$this->config = $this->getMockBuilder('\\OCP\\IConfig')->getMock(); | |||||
$this->timeFactory = $this->getMockBuilder('\\OCP\\AppFramework\\Utility\\ITimeFactory')->getMock(); | |||||
$this->l10n = $this->getMockBuilder('\\OCP\\IL10N')->getMock(); | |||||
$this->updateChecker = $this->getMockBuilder('\\OCA\\UpdateNotification\\UpdateChecker') | $this->updateChecker = $this->getMockBuilder('\\OCA\\UpdateNotification\\UpdateChecker') | ||||
->disableOriginalConstructor()->getMock(); | ->disableOriginalConstructor()->getMock(); | ||||
$this->dateTimeFormatter = $this->getMock('\\OCP\\IDateTimeFormatter'); | |||||
$this->dateTimeFormatter = $this->getMockBuilder('\\OCP\\IDateTimeFormatter')->getMock(); | |||||
$this->adminController = new AdminController( | $this->adminController = new AdminController( | ||||
'updatenotification', | 'updatenotification', |
public function setUp() { | public function setUp() { | ||||
parent::setUp(); | parent::setUp(); | ||||
$this->config = $this->getMock('OCP\IConfig'); | |||||
$this->notificationManager = $this->getMock('OCP\Notification\IManager'); | |||||
$this->groupManager = $this->getMock('OCP\IGroupManager'); | |||||
$this->appManager = $this->getMock('OCP\App\IAppManager'); | |||||
$this->client = $this->getMock('OCP\Http\Client\IClientService'); | |||||
$this->urlGenerator = $this->getMock('OCP\IURLGenerator'); | |||||
$this->config = $this->getMockBuilder('OCP\IConfig')->getMock(); | |||||
$this->notificationManager = $this->getMockBuilder('OCP\Notification\IManager')->getMock(); | |||||
$this->groupManager = $this->getMockBuilder('OCP\IGroupManager')->getMock(); | |||||
$this->appManager = $this->getMockBuilder('OCP\App\IAppManager')->getMock(); | |||||
$this->client = $this->getMockBuilder('OCP\Http\Client\IClientService')->getMock(); | |||||
$this->urlGenerator = $this->getMockBuilder('OCP\IURLGenerator')->getMock(); | |||||
} | } | ||||
/** | /** | ||||
} | } | ||||
if ($createNotification) { | if ($createNotification) { | ||||
$notification = $this->getMock('OCP\Notification\INotification'); | |||||
$notification = $this->getMockBuilder('OCP\Notification\INotification')->getMock(); | |||||
$notification->expects($this->once()) | $notification->expects($this->once()) | ||||
->method('setApp') | ->method('setApp') | ||||
->with('updatenotification') | ->with('updatenotification') | ||||
* @param string $version | * @param string $version | ||||
*/ | */ | ||||
public function testDeleteOutdatedNotifications($app, $version) { | public function testDeleteOutdatedNotifications($app, $version) { | ||||
$notification = $this->getMock('OCP\Notification\INotification'); | |||||
$notification = $this->getMockBuilder('OCP\Notification\INotification')->getMock(); | |||||
$notification->expects($this->once()) | $notification->expects($this->once()) | ||||
->method('setApp') | ->method('setApp') | ||||
->with('updatenotification') | ->with('updatenotification') | ||||
protected function getUsers(array $userIds) { | protected function getUsers(array $userIds) { | ||||
$users = []; | $users = []; | ||||
foreach ($userIds as $uid) { | foreach ($userIds as $uid) { | ||||
$user = $this->getMock('OCP\IUser'); | |||||
$user = $this->getMockBuilder('OCP\IUser')->getMock(); | |||||
$user->expects($this->any()) | $user->expects($this->any()) | ||||
->method('getUID') | ->method('getUID') | ||||
->willReturn($uid); | ->willReturn($uid); | ||||
* @return \OCP\IGroup|\PHPUnit_Framework_MockObject_MockObject | * @return \OCP\IGroup|\PHPUnit_Framework_MockObject_MockObject | ||||
*/ | */ | ||||
protected function getGroup($gid) { | protected function getGroup($gid) { | ||||
$group = $this->getMock('OCP\IGroup'); | |||||
$group = $this->getMockBuilder('OCP\IGroup')->getMock(); | |||||
$group->expects($this->any()) | $group->expects($this->any()) | ||||
->method('getGID') | ->method('getGID') | ||||
->willReturn($gid); | ->willReturn($gid); |
public function setUp() { | public function setUp() { | ||||
parent::setUp(); | parent::setUp(); | ||||
$this->notificationManager = $this->getMock('OCP\Notification\IManager'); | |||||
$this->l10nFactory = $this->getMock('OCP\L10n\IFactory'); | |||||
$this->notificationManager = $this->getMockBuilder('OCP\Notification\IManager')->getMock(); | |||||
$this->l10nFactory = $this->getMockBuilder('OCP\L10n\IFactory')->getMock(); | |||||
} | } | ||||
/** | /** | ||||
public function testUpdateAlreadyInstalledCheck($versionNotification, $versionInstalled, $exception) { | public function testUpdateAlreadyInstalledCheck($versionNotification, $versionInstalled, $exception) { | ||||
$notifier = $this->getNotifier(); | $notifier = $this->getNotifier(); | ||||
$notification = $this->getMock('OCP\Notification\INotification'); | |||||
$notification = $this->getMockBuilder('OCP\Notification\INotification')->getMock(); | |||||
$notification->expects($this->once()) | $notification->expects($this->once()) | ||||
->method('getObjectId') | ->method('getObjectId') | ||||
->willReturn($versionNotification); | ->willReturn($versionNotification); |
public function setUp() { | public function setUp() { | ||||
parent::setUp(); | parent::setUp(); | ||||
$this->config = $this->getMock('\\OCP\\IConfig'); | |||||
$this->timeFactory = $this->getMock('\\OCP\\AppFramework\\Utility\\ITimeFactory'); | |||||
$this->config = $this->getMockBuilder('\\OCP\\IConfig')->getMock(); | |||||
$this->timeFactory = $this->getMockBuilder('\\OCP\\AppFramework\\Utility\\ITimeFactory')->getMock(); | |||||
$this->resetTokenBackgroundJob = new ResetTokenBackgroundJob($this->config, $this->timeFactory); | $this->resetTokenBackgroundJob = new ResetTokenBackgroundJob($this->config, $this->timeFactory); | ||||
} | } | ||||