summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-08-15 16:43:22 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-08-15 16:43:22 +0200
commit7ffb7b0d846241c8cc6b45a3c85b2374c6d026ae (patch)
tree8472e73eb69f8495405231d44e1d580cbd0942bd /apps
parent8a7a0f328746230dd896ccc53b3ada271a91b930 (diff)
downloadnextcloud-server-7ffb7b0d846241c8cc6b45a3c85b2374c6d026ae.tar.gz
nextcloud-server-7ffb7b0d846241c8cc6b45a3c85b2374c6d026ae.zip
Use MockBuilder instead of createMock
CI uses an older PHPUnit
Diffstat (limited to 'apps')
-rw-r--r--apps/encryption/tests/Settings/AdminTest.php12
-rw-r--r--apps/federatedfilesharing/tests/Settings/AdminTest.php2
-rw-r--r--apps/federation/tests/Settings/AdminTest.php2
-rw-r--r--apps/files/tests/Settings/AdminTest.php4
-rw-r--r--apps/files_external/tests/Settings/AdminTest.php8
-rw-r--r--apps/files_external/tests/Settings/SectionTest.php2
-rw-r--r--apps/theming/tests/Settings/AdminTest.php8
-rw-r--r--apps/theming/tests/Settings/SectionTest.php2
-rw-r--r--apps/updatenotification/tests/Controller/AdminControllerTest.php16
-rw-r--r--apps/user_ldap/tests/Settings/AdminTest.php2
-rw-r--r--apps/user_ldap/tests/Settings/SectionTest.php2
11 files changed, 30 insertions, 30 deletions
diff --git a/apps/encryption/tests/Settings/AdminTest.php b/apps/encryption/tests/Settings/AdminTest.php
index 5b0b577e058..93896585dad 100644
--- a/apps/encryption/tests/Settings/AdminTest.php
+++ b/apps/encryption/tests/Settings/AdminTest.php
@@ -52,12 +52,12 @@ class AdminTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->l = $this->createMock('\OCP\IL10N');
- $this->logger = $this->createMock('\OCP\ILogger');
- $this->userSession = $this->createMock('\OCP\IUserSession');
- $this->config = $this->createMock('\OCP\IConfig');
- $this->userManager = $this->createMock('\OCP\IUserManager');
- $this->session = $this->createMock('\OCP\ISession');
+ $this->l = $this->getMockBuilder('\OCP\IL10N')->getMock();
+ $this->logger = $this->getMockBuilder('\OCP\ILogger')->getMock();
+ $this->userSession = $this->getMockBuilder('\OCP\IUserSession')->getMock();
+ $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
+ $this->userManager = $this->getMockBuilder('\OCP\IUserManager')->getMock();
+ $this->session = $this->getMockBuilder('\OCP\ISession')->getMock();
$this->admin = new Admin(
$this->l,
diff --git a/apps/federatedfilesharing/tests/Settings/AdminTest.php b/apps/federatedfilesharing/tests/Settings/AdminTest.php
index e082e7bff23..60fadca7b56 100644
--- a/apps/federatedfilesharing/tests/Settings/AdminTest.php
+++ b/apps/federatedfilesharing/tests/Settings/AdminTest.php
@@ -35,7 +35,7 @@ class AdminTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->federatedShareProvider = $this->createMock('\OCA\FederatedFileSharing\FederatedShareProvider');
+ $this->federatedShareProvider = $this->getMockBuilder('\OCA\FederatedFileSharing\FederatedShareProvider')->disableOriginalConstructor()->getMock();
$this->admin = new Admin(
$this->federatedShareProvider
);
diff --git a/apps/federation/tests/Settings/AdminTest.php b/apps/federation/tests/Settings/AdminTest.php
index 78cb7201dcd..758bda6bc5e 100644
--- a/apps/federation/tests/Settings/AdminTest.php
+++ b/apps/federation/tests/Settings/AdminTest.php
@@ -36,7 +36,7 @@ class AdminTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->trustedServers = $this->createMock('\OCA\Federation\TrustedServers');
+ $this->trustedServers = $this->getMockBuilder('\OCA\Federation\TrustedServers')->disableOriginalConstructor()->getMock();
$this->admin = new Admin(
$this->trustedServers
);
diff --git a/apps/files/tests/Settings/AdminTest.php b/apps/files/tests/Settings/AdminTest.php
index c536377af93..1ab8a992879 100644
--- a/apps/files/tests/Settings/AdminTest.php
+++ b/apps/files/tests/Settings/AdminTest.php
@@ -40,8 +40,8 @@ class AdminTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->iniGetWrapper = $this->createMock('\bantu\IniGetWrapper\IniGetWrapper');
- $this->request = $this->createMock('\OCP\IRequest');
+ $this->iniGetWrapper = $this->getMockBuilder('\bantu\IniGetWrapper\IniGetWrapper')->disableOriginalConstructor()->getMock();
+ $this->request = $this->getMockBuilder('\OCP\IRequest')->getMock();
$this->admin = new Admin(
$this->iniGetWrapper,
$this->request
diff --git a/apps/files_external/tests/Settings/AdminTest.php b/apps/files_external/tests/Settings/AdminTest.php
index 1918e800c9b..fdf9680e7c3 100644
--- a/apps/files_external/tests/Settings/AdminTest.php
+++ b/apps/files_external/tests/Settings/AdminTest.php
@@ -45,10 +45,10 @@ class AdminTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->encryptionManager = $this->createMock('\OCP\Encryption\IManager');
- $this->globalStoragesService = $this->createMock('\OCA\Files_External\Service\GlobalStoragesService');
- $this->backendService = $this->createMock('\OCA\Files_External\Service\BackendService');
- $this->globalAuth = $this->createMock('\OCA\Files_External\Lib\Auth\Password\GlobalAuth');
+ $this->encryptionManager = $this->getMockBuilder('\OCP\Encryption\IManager')->getMock();
+ $this->globalStoragesService = $this->getMockBuilder('\OCA\Files_External\Service\GlobalStoragesService')->disableOriginalConstructor()->getMock();
+ $this->backendService = $this->getMockBuilder('\OCA\Files_External\Service\BackendService')->disableOriginalConstructor()->getMock();
+ $this->globalAuth = $this->getMockBuilder('\OCA\Files_External\Lib\Auth\Password\GlobalAuth')->disableOriginalConstructor()->getMock();
$this->admin = new Admin(
$this->encryptionManager,
diff --git a/apps/files_external/tests/Settings/SectionTest.php b/apps/files_external/tests/Settings/SectionTest.php
index 9ab456fe307..b5dfb28b382 100644
--- a/apps/files_external/tests/Settings/SectionTest.php
+++ b/apps/files_external/tests/Settings/SectionTest.php
@@ -35,7 +35,7 @@ class SectionTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->l = $this->createMock('\OCP\IL10N');
+ $this->l = $this->getMockBuilder('\OCP\IL10N')->disableOriginalConstructor()->getMock();
$this->section = new Section(
$this->l
diff --git a/apps/theming/tests/Settings/AdminTest.php b/apps/theming/tests/Settings/AdminTest.php
index ff42c6997a6..18c2064e8ce 100644
--- a/apps/theming/tests/Settings/AdminTest.php
+++ b/apps/theming/tests/Settings/AdminTest.php
@@ -45,10 +45,10 @@ class AdminTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->config = $this->createMock('\OCP\IConfig');
- $this->l10n = $this->createMock('\OCP\IL10N');
- $this->themingDefaults = $this->createMock('\OCA\Theming\ThemingDefaults');
- $this->urlGenerator = $this->createMock('\OCP\IURLGenerator');
+ $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
+ $this->l10n = $this->getMockBuilder('\OCP\IL10N')->getMock();
+ $this->themingDefaults = $this->getMockBuilder('\OCA\Theming\ThemingDefaults')->disableOriginalConstructor()->getMock();
+ $this->urlGenerator = $this->getMockBuilder('\OCP\IURLGenerator')->getMock();
$this->admin = new Admin(
$this->config,
diff --git a/apps/theming/tests/Settings/SectionTest.php b/apps/theming/tests/Settings/SectionTest.php
index e8a9a217f1f..3a3a4375236 100644
--- a/apps/theming/tests/Settings/SectionTest.php
+++ b/apps/theming/tests/Settings/SectionTest.php
@@ -35,7 +35,7 @@ class SectionTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->l = $this->createMock('\OCP\IL10N');
+ $this->l = $this->getMockBuilder('\OCP\IL10N')->getMock();
$this->section = new Section(
$this->l
diff --git a/apps/updatenotification/tests/Controller/AdminControllerTest.php b/apps/updatenotification/tests/Controller/AdminControllerTest.php
index a4398715885..cf99679e680 100644
--- a/apps/updatenotification/tests/Controller/AdminControllerTest.php
+++ b/apps/updatenotification/tests/Controller/AdminControllerTest.php
@@ -59,14 +59,14 @@ class AdminControllerTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->request = $this->createMock('\\OCP\\IRequest');
- $this->jobList = $this->createMock('\\OCP\\BackgroundJob\\IJobList');
- $this->secureRandom = $this->createMock('\\OCP\\Security\\ISecureRandom');
- $this->config = $this->createMock('\\OCP\\IConfig');
- $this->timeFactory = $this->createMock('\\OCP\\AppFramework\\Utility\\ITimeFactory');
- $this->l10n = $this->createMock('\\OCP\\IL10N');
- $this->updateChecker = $this->createMock('\\OCA\\UpdateNotification\\UpdateChecker');
- $this->dateTimeFormatter = $this->createMock('\\OCP\\IDateTimeFormatter');
+ $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->getMockBuilder('\\OCP\\IDateTimeFormatter')->getMock();
$this->adminController = new AdminController(
'updatenotification',
diff --git a/apps/user_ldap/tests/Settings/AdminTest.php b/apps/user_ldap/tests/Settings/AdminTest.php
index e92684f3ce4..4ac5a14f58b 100644
--- a/apps/user_ldap/tests/Settings/AdminTest.php
+++ b/apps/user_ldap/tests/Settings/AdminTest.php
@@ -43,7 +43,7 @@ class AdminTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->l10n = $this->createMock('\OCP\IL10N');
+ $this->l10n = $this->getMockBuilder('\OCP\IL10N')->getMock();
$this->admin = new Admin(
$this->l10n
diff --git a/apps/user_ldap/tests/Settings/SectionTest.php b/apps/user_ldap/tests/Settings/SectionTest.php
index b5b1f97ce3c..2d2165b8e56 100644
--- a/apps/user_ldap/tests/Settings/SectionTest.php
+++ b/apps/user_ldap/tests/Settings/SectionTest.php
@@ -35,7 +35,7 @@ class SectionTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->l = $this->createMock('\OCP\IL10N');
+ $this->l = $this->getMockBuilder('\OCP\IL10N')->getMock();
$this->section = new Section(
$this->l