summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2016-08-16 14:50:31 +0200
committerGitHub <noreply@github.com>2016-08-16 14:50:31 +0200
commitd14c6ef78cffdb7439470dec0dd948eee91086d6 (patch)
tree36f22cc424c992c541fe35d9312c2ca9ca3db382 /apps
parentf7bc5ad43b9cee9befa317d251446bc4e5e81f9c (diff)
parent3b948f76945ac6ff148e88a04293933576d090b9 (diff)
downloadnextcloud-server-d14c6ef78cffdb7439470dec0dd948eee91086d6.tar.gz
nextcloud-server-d14c6ef78cffdb7439470dec0dd948eee91086d6.zip
Merge pull request #860 from nextcloud/fix_updatenotifcations_warnings
Fix deprecated getMock warning
Diffstat (limited to 'apps')
-rw-r--r--apps/updatenotification/tests/Controller/AdminControllerTest.php14
-rw-r--r--apps/updatenotification/tests/Notification/BackgroundJobTest.php20
-rw-r--r--apps/updatenotification/tests/Notification/NotifierTest.php6
-rw-r--r--apps/updatenotification/tests/ResetTokenBackgroundJobTest.php4
4 files changed, 22 insertions, 22 deletions
diff --git a/apps/updatenotification/tests/Controller/AdminControllerTest.php b/apps/updatenotification/tests/Controller/AdminControllerTest.php
index 0343542ef41..20b0c534c46 100644
--- a/apps/updatenotification/tests/Controller/AdminControllerTest.php
+++ b/apps/updatenotification/tests/Controller/AdminControllerTest.php
@@ -59,15 +59,15 @@ class AdminControllerTest extends TestCase {
public function 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')
->disableOriginalConstructor()->getMock();
- $this->dateTimeFormatter = $this->getMock('\\OCP\\IDateTimeFormatter');
+ $this->dateTimeFormatter = $this->getMockBuilder('\\OCP\\IDateTimeFormatter')->getMock();
$this->adminController = new AdminController(
'updatenotification',
diff --git a/apps/updatenotification/tests/Notification/BackgroundJobTest.php b/apps/updatenotification/tests/Notification/BackgroundJobTest.php
index c60a1429576..c3a4c28830d 100644
--- a/apps/updatenotification/tests/Notification/BackgroundJobTest.php
+++ b/apps/updatenotification/tests/Notification/BackgroundJobTest.php
@@ -51,12 +51,12 @@ class BackgroundJobTest extends TestCase {
public function 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();
}
/**
@@ -279,7 +279,7 @@ class BackgroundJobTest extends TestCase {
}
if ($createNotification) {
- $notification = $this->getMock('OCP\Notification\INotification');
+ $notification = $this->getMockBuilder('OCP\Notification\INotification')->getMock();
$notification->expects($this->once())
->method('setApp')
->with('updatenotification')
@@ -380,7 +380,7 @@ class BackgroundJobTest extends TestCase {
* @param string $version
*/
public function testDeleteOutdatedNotifications($app, $version) {
- $notification = $this->getMock('OCP\Notification\INotification');
+ $notification = $this->getMockBuilder('OCP\Notification\INotification')->getMock();
$notification->expects($this->once())
->method('setApp')
->with('updatenotification')
@@ -408,7 +408,7 @@ class BackgroundJobTest extends TestCase {
protected function getUsers(array $userIds) {
$users = [];
foreach ($userIds as $uid) {
- $user = $this->getMock('OCP\IUser');
+ $user = $this->getMockBuilder('OCP\IUser')->getMock();
$user->expects($this->any())
->method('getUID')
->willReturn($uid);
@@ -422,7 +422,7 @@ class BackgroundJobTest extends TestCase {
* @return \OCP\IGroup|\PHPUnit_Framework_MockObject_MockObject
*/
protected function getGroup($gid) {
- $group = $this->getMock('OCP\IGroup');
+ $group = $this->getMockBuilder('OCP\IGroup')->getMock();
$group->expects($this->any())
->method('getGID')
->willReturn($gid);
diff --git a/apps/updatenotification/tests/Notification/NotifierTest.php b/apps/updatenotification/tests/Notification/NotifierTest.php
index 8848a3124fb..e5ccb291b5c 100644
--- a/apps/updatenotification/tests/Notification/NotifierTest.php
+++ b/apps/updatenotification/tests/Notification/NotifierTest.php
@@ -38,8 +38,8 @@ class NotifierTest extends TestCase {
public function 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();
}
/**
@@ -81,7 +81,7 @@ class NotifierTest extends TestCase {
public function testUpdateAlreadyInstalledCheck($versionNotification, $versionInstalled, $exception) {
$notifier = $this->getNotifier();
- $notification = $this->getMock('OCP\Notification\INotification');
+ $notification = $this->getMockBuilder('OCP\Notification\INotification')->getMock();
$notification->expects($this->once())
->method('getObjectId')
->willReturn($versionNotification);
diff --git a/apps/updatenotification/tests/ResetTokenBackgroundJobTest.php b/apps/updatenotification/tests/ResetTokenBackgroundJobTest.php
index 71b72a40021..a52d46040cd 100644
--- a/apps/updatenotification/tests/ResetTokenBackgroundJobTest.php
+++ b/apps/updatenotification/tests/ResetTokenBackgroundJobTest.php
@@ -37,8 +37,8 @@ class ResetTokenBackgroundJobTest extends TestCase {
public function 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);
}