summaryrefslogtreecommitdiffstats
path: root/tests/Core
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-11-01 15:37:29 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-11-01 15:37:29 +0100
commite2805f02aa51c602c581bd4f09b99dd791a42df4 (patch)
tree4ea194f47aa315874c2aac31c30dbdb14110539b /tests/Core
parent2b4b3b1986e58305c08941f77a693a80cc3d5b85 (diff)
parent52b679a2d6f6b273f46334b15534ab312f974a1a (diff)
downloadnextcloud-server-e2805f02aa51c602c581bd4f09b99dd791a42df4.tar.gz
nextcloud-server-e2805f02aa51c602c581bd4f09b99dd791a42df4.zip
Merge branch 'master' into autocomplete-gui
Diffstat (limited to 'tests/Core')
-rw-r--r--tests/Core/Controller/AvatarControllerTest.php10
-rw-r--r--tests/Core/Controller/ChangePasswordControllerTest.php9
-rw-r--r--tests/Core/Controller/LostControllerTest.php6
-rw-r--r--tests/Core/Middleware/TwoFactorMiddlewareTest.php6
4 files changed, 17 insertions, 14 deletions
diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php
index 1a1f1130480..de568438022 100644
--- a/tests/Core/Controller/AvatarControllerTest.php
+++ b/tests/Core/Controller/AvatarControllerTest.php
@@ -85,16 +85,16 @@ class AvatarControllerTest extends \Test\TestCase {
$this->avatarManager = $this->getMockBuilder('OCP\IAvatarManager')->getMock();
$this->cache = $this->getMockBuilder('OCP\ICache')
->disableOriginalConstructor()->getMock();
- $this->l = $this->getMockBuilder('OCP\IL10N')->getMock();
+ $this->l = $this->getMockBuilder(IL10N::class)->getMock();
$this->l->method('t')->will($this->returnArgument(0));
- $this->userManager = $this->getMockBuilder('OCP\IUserManager')->getMock();
- $this->request = $this->getMockBuilder('OCP\IRequest')->getMock();
+ $this->userManager = $this->getMockBuilder(IUserManager::class)->getMock();
+ $this->request = $this->getMockBuilder(IRequest::class)->getMock();
$this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder')->getMock();
- $this->logger = $this->getMockBuilder('OCP\ILogger')->getMock();
+ $this->logger = $this->getMockBuilder(ILogger::class)->getMock();
$this->timeFactory = $this->getMockBuilder('OC\AppFramework\Utility\TimeFactory')->getMock();
$this->avatarMock = $this->getMockBuilder('OCP\IAvatar')->getMock();
- $this->userMock = $this->getMockBuilder('OCP\IUser')->getMock();
+ $this->userMock = $this->getMockBuilder(IUser::class)->getMock();
$this->avatarController = new AvatarController(
'core',
diff --git a/tests/Core/Controller/ChangePasswordControllerTest.php b/tests/Core/Controller/ChangePasswordControllerTest.php
index ea3abb58e2f..851b5bd6c76 100644
--- a/tests/Core/Controller/ChangePasswordControllerTest.php
+++ b/tests/Core/Controller/ChangePasswordControllerTest.php
@@ -29,6 +29,7 @@ use OCP\AppFramework\Http\JSONResponse;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\IRequest;
+use OCP\IUser;
use OCP\IUserManager;
class ChangePasswordControllerTest extends \Test\TestCase {
@@ -91,7 +92,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
}
public function testChangePersonalPasswordCommonPassword() {
- $user = $this->getMockBuilder('OCP\IUser')->getMock();
+ $user = $this->getMockBuilder(IUser::class)->getMock();
$this->userManager->expects($this->once())
->method('checkPassword')
->with($this->userId, 'old')
@@ -114,7 +115,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
}
public function testChangePersonalPasswordNoNewPassword() {
- $user = $this->getMockBuilder('OCP\IUser')->getMock();
+ $user = $this->getMockBuilder(IUser::class)->getMock();
$this->userManager->expects($this->once())
->method('checkPassword')
->with($this->userId, 'old')
@@ -130,7 +131,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
}
public function testChangePersonalPasswordCantSetPassword() {
- $user = $this->getMockBuilder('OCP\IUser')->getMock();
+ $user = $this->getMockBuilder(IUser::class)->getMock();
$this->userManager->expects($this->once())
->method('checkPassword')
->with($this->userId, 'old')
@@ -150,7 +151,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
}
public function testChangePersonalPassword() {
- $user = $this->getMockBuilder('OCP\IUser')->getMock();
+ $user = $this->getMockBuilder(IUser::class)->getMock();
$this->userManager->expects($this->once())
->method('checkPassword')
->with($this->userId, 'old')
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php
index 196b1da352b..1e51de649e3 100644
--- a/tests/Core/Controller/LostControllerTest.php
+++ b/tests/Core/Controller/LostControllerTest.php
@@ -105,9 +105,9 @@ class LostControllerTest extends \Test\TestCase {
}));
$this->defaults = $this->getMockBuilder('\OCP\Defaults')
->disableOriginalConstructor()->getMock();
- $this->userManager = $this->getMockBuilder('\OCP\IUserManager')
+ $this->userManager = $this->getMockBuilder(IUserManager::class)
->disableOriginalConstructor()->getMock();
- $this->urlGenerator = $this->getMockBuilder('\OCP\IURLGenerator')
+ $this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)
->disableOriginalConstructor()->getMock();
$this->mailer = $this->getMockBuilder('\OCP\Mail\IMailer')
->disableOriginalConstructor()->getMock();
@@ -115,7 +115,7 @@ class LostControllerTest extends \Test\TestCase {
->disableOriginalConstructor()->getMock();
$this->timeFactory = $this->getMockBuilder('\OCP\AppFramework\Utility\ITimeFactory')
->disableOriginalConstructor()->getMock();
- $this->request = $this->getMockBuilder('OCP\IRequest')
+ $this->request = $this->getMockBuilder(IRequest::class)
->disableOriginalConstructor()->getMock();
$this->encryptionManager = $this->getMockBuilder(IManager::class)
->disableOriginalConstructor()->getMock();
diff --git a/tests/Core/Middleware/TwoFactorMiddlewareTest.php b/tests/Core/Middleware/TwoFactorMiddlewareTest.php
index 56022c78bdd..eb72b3e6796 100644
--- a/tests/Core/Middleware/TwoFactorMiddlewareTest.php
+++ b/tests/Core/Middleware/TwoFactorMiddlewareTest.php
@@ -22,8 +22,10 @@
namespace Test\Core\Middleware;
+use OC\Authentication\TwoFactorAuth\Manager;
use OC\Core\Middleware\TwoFactorMiddleware;
use OC\AppFramework\Http\Request;
+use OC\User\Session;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Utility\IControllerMethodReflector;
use OCP\IConfig;
@@ -51,10 +53,10 @@ class TwoFactorMiddlewareTest extends TestCase {
protected function setUp() {
parent::setUp();
- $this->twoFactorManager = $this->getMockBuilder('\OC\Authentication\TwoFactorAuth\Manager')
+ $this->twoFactorManager = $this->getMockBuilder(Manager::class)
->disableOriginalConstructor()
->getMock();
- $this->userSession = $this->getMockBuilder('\OC\User\Session')
+ $this->userSession = $this->getMockBuilder(Session::class)
->disableOriginalConstructor()
->getMock();
$this->session = $this->createMock(ISession::class);