aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Settings
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-09-12 22:00:29 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-09-13 09:09:53 +0200
commit206b48d250db30259061b1fb762fa4874c333773 (patch)
treedb6e29232750abbbabd1c6cc1cedad64d89f7d37 /tests/Settings
parentd616984879d7fcf683f19eb40a842a583c7528e3 (diff)
downloadnextcloud-server-206b48d250db30259061b1fb762fa4874c333773.tar.gz
nextcloud-server-206b48d250db30259061b1fb762fa4874c333773.zip
Fix getMock UsersControllerTest
Diffstat (limited to 'tests/Settings')
-rw-r--r--tests/Settings/Controller/UsersControllerTest.php29
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/Settings/Controller/UsersControllerTest.php b/tests/Settings/Controller/UsersControllerTest.php
index 244d1f744d3..e036e299e00 100644
--- a/tests/Settings/Controller/UsersControllerTest.php
+++ b/tests/Settings/Controller/UsersControllerTest.php
@@ -13,6 +13,9 @@ namespace Tests\Settings\Controller;
use \OC\Settings\Application;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
+use OCP\IAvatar;
+use OCP\IAvatarManager;
+use OCP\IUser;
/**
* @group DB
@@ -60,11 +63,11 @@ class UsersControllerTest extends \Test\TestCase {
/*
* Set default avtar behaviour for whole testsuite
*/
- $this->container['OCP\\IAvatarManager'] = $this->getMock('OCP\IAvatarManager');
+ $this->container['OCP\\IAvatarManager'] = $this->createMock(IAvatarManager::class);
- $avatarExists = $this->getMock('OCP\IAvatar');
+ $avatarExists = $this->createMock(IAvatar::class);
$avatarExists->method('exists')->willReturn(true);
- $avatarNotExists = $this->getMock('OCP\IAvatar');
+ $avatarNotExists = $this->createMock(IAvatar::class);
$avatarNotExists->method('exists')->willReturn(false);
$this->container['OCP\\IAvatarManager']
->method('getAvatar')
@@ -1861,7 +1864,7 @@ class UsersControllerTest extends \Test\TestCase {
}
public function testSetDisplayNameNull() {
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->createMock(IUser::class);
$user->method('getUID')->willReturn('userName');
$this->container['UserSession']
@@ -1885,33 +1888,33 @@ class UsersControllerTest extends \Test\TestCase {
public function dataSetDisplayName() {
$data = [];
- $user1 = $this->getMock('\OCP\IUser');
+ $user1 = $this->createMock(IUser::class);
$user1->method('getUID')->willReturn('user1');
$user1->method('canChangeDisplayName')->willReturn(true);
$data[] = [$user1, $user1, false, false, true];
- $user1 = $this->getMock('\OCP\IUser');
+ $user1 = $this->createMock(IUser::class);
$user1->method('getUID')->willReturn('user1');
$user1->method('canChangeDisplayName')->willReturn(false);
$data[] = [$user1, $user1, false, false, false];
- $user1 = $this->getMock('\OCP\IUser');
+ $user1 = $this->createMock(IUser::class);
$user1->method('getUID')->willReturn('user1');
- $user2 = $this->getMock('\OCP\IUser');
+ $user2 = $this->createMock(IUser::class);
$user2->method('getUID')->willReturn('user2');
$user2->method('canChangeDisplayName')->willReturn(true);
$data[] = [$user1, $user2, false, false, false];
- $user1 = $this->getMock('\OCP\IUser');
+ $user1 = $this->createMock(IUser::class);
$user1->method('getUID')->willReturn('user1');
- $user2 = $this->getMock('\OCP\IUser');
+ $user2 = $this->createMock(IUser::class);
$user2->method('getUID')->willReturn('user2');
$user2->method('canChangeDisplayName')->willReturn(true);
$data[] = [$user1, $user2, true, false, true];
- $user1 = $this->getMock('\OCP\IUser');
+ $user1 = $this->createMock(IUser::class);
$user1->method('getUID')->willReturn('user1');
- $user2 = $this->getMock('\OCP\IUser');
+ $user2 = $this->createMock(IUser::class);
$user2->method('getUID')->willReturn('user2');
$user2->method('canChangeDisplayName')->willReturn(true);
$data[] = [$user1, $user2, false, true, true];
@@ -1981,7 +1984,7 @@ class UsersControllerTest extends \Test\TestCase {
}
public function testSetDisplayNameFails() {
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->createMock(IUser::class);
$user->method('canChangeDisplayname')->willReturn(true);
$user->method('getUID')->willReturn('user');
$user->expects($this->once())