diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2016-05-11 19:38:49 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-05-11 19:38:49 +0200 |
commit | 2a05035339901e630fccae90639985c00d6803e9 (patch) | |
tree | 12e8652343f12780ab1d24599b9adda4f8dec952 /apps | |
parent | e03f9e8103d7b9a8336c551d0f8ecee029f29723 (diff) | |
download | nextcloud-server-2a05035339901e630fccae90639985c00d6803e9.tar.gz nextcloud-server-2a05035339901e630fccae90639985c00d6803e9.zip |
Move Provisioning api to PSR-4 (#24510)
* Move app to PSR-4
* Fix setUp method
* Fix the tests
Diffstat (limited to 'apps')
-rw-r--r-- | apps/provisioning_api/appinfo/info.xml | 1 | ||||
-rw-r--r-- | apps/provisioning_api/lib/Apps.php (renamed from apps/provisioning_api/lib/apps.php) | 0 | ||||
-rw-r--r-- | apps/provisioning_api/lib/Groups.php (renamed from apps/provisioning_api/lib/groups.php) | 0 | ||||
-rw-r--r-- | apps/provisioning_api/lib/Users.php (renamed from apps/provisioning_api/lib/users.php) | 2 | ||||
-rw-r--r-- | apps/provisioning_api/tests/AppsTest.php (renamed from apps/provisioning_api/tests/appstest.php) | 15 | ||||
-rw-r--r-- | apps/provisioning_api/tests/GroupsTest.php (renamed from apps/provisioning_api/tests/groupstest.php) | 30 | ||||
-rw-r--r-- | apps/provisioning_api/tests/TestCase.php (renamed from apps/provisioning_api/tests/testcase.php) | 0 | ||||
-rw-r--r-- | apps/provisioning_api/tests/UsersTest.php (renamed from apps/provisioning_api/tests/userstest.php) | 322 |
8 files changed, 194 insertions, 176 deletions
diff --git a/apps/provisioning_api/appinfo/info.xml b/apps/provisioning_api/appinfo/info.xml index 027f1ae039e..2aa0583ce4c 100644 --- a/apps/provisioning_api/appinfo/info.xml +++ b/apps/provisioning_api/appinfo/info.xml @@ -18,6 +18,7 @@ <admin>admin-provisioning-api</admin> </documentation> <version>0.5.0</version> + <namespace>Provisioning_API</namespace> <types> <prevent_group_restriction/> </types> diff --git a/apps/provisioning_api/lib/apps.php b/apps/provisioning_api/lib/Apps.php index f0079b8a8f3..f0079b8a8f3 100644 --- a/apps/provisioning_api/lib/apps.php +++ b/apps/provisioning_api/lib/Apps.php diff --git a/apps/provisioning_api/lib/groups.php b/apps/provisioning_api/lib/Groups.php index 6784894dbc9..6784894dbc9 100644 --- a/apps/provisioning_api/lib/groups.php +++ b/apps/provisioning_api/lib/Groups.php diff --git a/apps/provisioning_api/lib/users.php b/apps/provisioning_api/lib/Users.php index 2749372c393..64760497b61 100644 --- a/apps/provisioning_api/lib/users.php +++ b/apps/provisioning_api/lib/Users.php @@ -43,7 +43,7 @@ class Users { private $userManager; /** @var IConfig */ private $config; - /** @var IGroupManager */ + /** @var IGroupManager|\OC\Group\Manager */ // FIXME Requires a method that is not on the interface private $groupManager; /** @var IUserSession */ private $userSession; diff --git a/apps/provisioning_api/tests/appstest.php b/apps/provisioning_api/tests/AppsTest.php index 260bb4d527e..7dc6ec8a371 100644 --- a/apps/provisioning_api/tests/appstest.php +++ b/apps/provisioning_api/tests/AppsTest.php @@ -25,6 +25,8 @@ */ namespace OCA\Provisioning_API\Tests; + + use OC\OCSClient; use OCA\Provisioning_API\Apps; use OCP\API; @@ -45,16 +47,19 @@ class AppsTest extends TestCase { private $api; /** @var IUserSession */ private $userSession; - /** @var OCSClient */ + /** @var OCSClient|\PHPUnit_Framework_MockObject_MockObject */ private $ocsClient; - public function setup() { - parent::setup(); + protected function setUp() { + parent::setUp(); + $this->appManager = \OC::$server->getAppManager(); $this->groupManager = \OC::$server->getGroupManager(); $this->userSession = \OC::$server->getUserSession(); - $this->ocsClient = $this->getMockBuilder('\OC\OCSClient') - ->disableOriginalConstructor()->getMock(); + $this->ocsClient = $this->getMockBuilder('OC\OCSClient') + ->disableOriginalConstructor() + ->getMock(); + $this->api = new Apps($this->appManager, $this->ocsClient); } diff --git a/apps/provisioning_api/tests/groupstest.php b/apps/provisioning_api/tests/GroupsTest.php index 1262f45cb3c..5864d597136 100644 --- a/apps/provisioning_api/tests/groupstest.php +++ b/apps/provisioning_api/tests/GroupsTest.php @@ -25,6 +25,8 @@ namespace OCA\Provisioning_API\Tests; +use OCA\Provisioning_API\Groups; +use OCP\API; use OCP\IGroupManager; use OCP\IUserSession; use OCP\IRequest; @@ -38,20 +40,26 @@ class GroupsTest extends \Test\TestCase { protected $request; /** @var \OC\SubAdmin|\PHPUnit_Framework_MockObject_MockObject */ protected $subAdminManager; - /** @var \OCA\Provisioning_API\Groups */ + /** @var Groups */ protected $api; - protected function setup() { - $this->subAdminManager = $this->getMockBuilder('OC\SubAdmin')->disableOriginalConstructor()->getMock(); + protected function setUp() { + parent::setUp(); - $this->groupManager = $this->getMockBuilder('OC\Group\Manager')->disableOriginalConstructor()->getMock(); + $this->subAdminManager = $this->getMockBuilder('OC\SubAdmin') + ->disableOriginalConstructor() + ->getMock(); + + $this->groupManager = $this->getMockBuilder('OC\Group\Manager') + ->disableOriginalConstructor() + ->getMock(); $this->groupManager ->method('getSubAdmin') ->willReturn($this->subAdminManager); $this->userSession = $this->getMock('OCP\IUserSession'); $this->request = $this->getMock('OCP\IRequest'); - $this->api = new \OCA\Provisioning_API\Groups( + $this->api = new Groups( $this->groupManager, $this->userSession, $this->request @@ -129,6 +137,10 @@ class GroupsTest extends \Test\TestCase { /** * @dataProvider dataGetGroups + * + * @param string|null $search + * @param int|null $limit + * @param int|null $offset */ public function testGetGroups($search, $limit, $offset) { $this->request @@ -161,7 +173,7 @@ class GroupsTest extends \Test\TestCase { $this->assertInstanceOf('OC_OCS_Result', $result); $this->assertFalse($result->succeeded()); - $this->assertEquals(\OCP\API::RESPOND_UNAUTHORISED, $result->getStatusCode()); + $this->assertEquals(API::RESPOND_UNAUTHORISED, $result->getStatusCode()); } @@ -215,7 +227,7 @@ class GroupsTest extends \Test\TestCase { $this->assertInstanceOf('OC_OCS_Result', $result); $this->assertFalse($result->succeeded()); - $this->assertEquals(\OCP\API::RESPOND_UNAUTHORISED, $result->getStatusCode()); + $this->assertEquals(API::RESPOND_UNAUTHORISED, $result->getStatusCode()); } public function testGetGroupAsAdmin() { @@ -252,12 +264,12 @@ class GroupsTest extends \Test\TestCase { $this->asUser(); $result = $this->api->getGroup([ - 'groupid' => $this->getUniqueId() + 'groupid' => $this->getUniqueID() ]); $this->assertInstanceOf('OC_OCS_Result', $result); $this->assertFalse($result->succeeded()); - $this->assertEquals(\OCP\API::RESPOND_NOT_FOUND, $result->getStatusCode()); + $this->assertEquals(API::RESPOND_NOT_FOUND, $result->getStatusCode()); $this->assertEquals('The requested group could not be found', $result->getMeta()['message']); } diff --git a/apps/provisioning_api/tests/testcase.php b/apps/provisioning_api/tests/TestCase.php index 743c1c9c44b..743c1c9c44b 100644 --- a/apps/provisioning_api/tests/testcase.php +++ b/apps/provisioning_api/tests/TestCase.php diff --git a/apps/provisioning_api/tests/userstest.php b/apps/provisioning_api/tests/UsersTest.php index 8f463ec8b88..264aede617f 100644 --- a/apps/provisioning_api/tests/userstest.php +++ b/apps/provisioning_api/tests/UsersTest.php @@ -61,21 +61,21 @@ class UsersTest extends OriginalTest { protected function setUp() { parent::setUp(); - $this->userManager = $this->getMock('\OCP\IUserManager'); - $this->config = $this->getMock('\OCP\IConfig'); - $this->groupManager = $this->getMockBuilder('\OC\Group\Manager') - ->disableOriginalConstructor()->getMock(); - $this->userSession = $this->getMock('\OCP\IUserSession'); - $this->logger = $this->getMock('\OCP\ILogger'); - $this->api = $this->getMockBuilder('\OCA\Provisioning_API\Users') + $this->userManager = $this->getMock('OCP\IUserManager'); + $this->config = $this->getMock('OCP\IConfig'); + $this->groupManager = $this->getMockBuilder('OC\Group\Manager') + ->disableOriginalConstructor() + ->getMock(); + $this->userSession = $this->getMock('OCP\IUserSession'); + $this->logger = $this->getMock('OCP\ILogger'); + $this->api = $this->getMockBuilder('OCA\Provisioning_API\Users') ->setConstructorArgs([ - $this->userManager, - $this->config, - $this->groupManager, - $this->userSession, - $this->logger, - ] - ) + $this->userManager, + $this->config, + $this->groupManager, + $this->userSession, + $this->logger, + ]) ->setMethods(['fillStorageInfo']) ->getMock(); } @@ -93,7 +93,7 @@ class UsersTest extends OriginalTest { public function testGetUsersAsAdmin() { $_GET['search'] = 'MyCustomSearch'; - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -125,7 +125,7 @@ class UsersTest extends OriginalTest { public function testGetUsersAsSubAdmin() { $_GET['search'] = 'MyCustomSearch'; - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -138,17 +138,17 @@ class UsersTest extends OriginalTest { ->expects($this->once()) ->method('isAdmin') ->will($this->returnValue(false)); - $firstGroup = $this->getMock('\OCP\IGroup'); + $firstGroup = $this->getMock('OCP\IGroup'); $firstGroup ->expects($this->once()) ->method('getGID') ->will($this->returnValue('FirstGroup')); - $secondGroup = $this->getMock('\OCP\IGroup'); + $secondGroup = $this->getMock('OCP\IGroup'); $secondGroup ->expects($this->once()) ->method('getGID') ->will($this->returnValue('SecondGroup')); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -181,7 +181,7 @@ class UsersTest extends OriginalTest { public function testGetUsersAsRegularUser() { $_GET['search'] = 'MyCustomSearch'; - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -194,7 +194,7 @@ class UsersTest extends OriginalTest { ->expects($this->once()) ->method('isAdmin') ->will($this->returnValue(false)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -221,7 +221,7 @@ class UsersTest extends OriginalTest { ->expects($this->once()) ->method('error') ->with('Failed addUser attempt: User already exists.', ['app' => 'ocs_api']); - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -248,7 +248,7 @@ class UsersTest extends OriginalTest { ->method('userExists') ->with('NewUser') ->willReturn(false); - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -280,7 +280,7 @@ class UsersTest extends OriginalTest { ->method('userExists') ->with('NewUser') ->willReturn(false); - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -326,7 +326,7 @@ class UsersTest extends OriginalTest { ->expects($this->once()) ->method('info') ->with('Successful addUser call with userid: NewUser', ['app' => 'ocs_api']); - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -354,7 +354,7 @@ class UsersTest extends OriginalTest { ->method('userExists') ->with('NewUser') ->willReturn(false); - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -373,13 +373,13 @@ class UsersTest extends OriginalTest { ->method('groupExists') ->with('ExistingGroup') ->willReturn(true); - $user = $this->getMock('\OCP\IUser'); + $user = $this->getMock('OCP\IUser'); $this->userManager ->expects($this->once()) ->method('createUser') ->with('NewUser', 'PasswordOfTheNewUser') ->willReturn($user); - $group = $this->getMock('\OCP\IGroup'); + $group = $this->getMock('OCP\IGroup'); $group ->expects($this->once()) ->method('addUser') @@ -418,7 +418,7 @@ class UsersTest extends OriginalTest { ->expects($this->once()) ->method('error') ->with('Failed addUser attempt with exception: User backend not found.', ['app' => 'ocs_api']); - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -440,7 +440,7 @@ class UsersTest extends OriginalTest { public function testAddUserAsRegularUser() { $_POST['userid'] = 'NewUser'; $_POST['password'] = 'PasswordOfTheNewUser'; - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -454,7 +454,7 @@ class UsersTest extends OriginalTest { ->method('isAdmin') ->with('regularUser') ->willReturn(false); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -474,7 +474,7 @@ class UsersTest extends OriginalTest { public function testAddUserAsSubAdminNoGroup() { $_POST['userid'] = 'NewUser'; $_POST['password'] = 'PasswordOfTheNewUser'; - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -488,7 +488,7 @@ class UsersTest extends OriginalTest { ->method('isAdmin') ->with('regularUser') ->willReturn(false); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -509,7 +509,7 @@ class UsersTest extends OriginalTest { $_POST['userid'] = 'NewUser'; $_POST['password'] = 'PasswordOfTheNewUser'; $_POST['groups'] = ['ExistingGroup']; - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -523,13 +523,13 @@ class UsersTest extends OriginalTest { ->method('isAdmin') ->with('regularUser') ->willReturn(false); - $existingGroup = $this->getMock('\OCP\IGroup'); + $existingGroup = $this->getMock('OCP\IGroup'); $this->groupManager ->expects($this->once()) ->method('get') ->with('ExistingGroup') ->willReturn($existingGroup); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -565,7 +565,7 @@ class UsersTest extends OriginalTest { ->method('userExists') ->with('NewUser') ->willReturn(false); - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -587,14 +587,14 @@ class UsersTest extends OriginalTest { ['ExistingGroup2'] ) ->willReturn(true); - $user = $this->getMock('\OCP\IUser'); + $user = $this->getMock('OCP\IUser'); $this->userManager ->expects($this->once()) ->method('createUser') ->with('NewUser', 'PasswordOfTheNewUser') ->willReturn($user); - $existingGroup1 = $this->getMock('\OCP\IGroup'); - $existingGroup2 = $this->getMock('\OCP\IGroup'); + $existingGroup1 = $this->getMock('OCP\IGroup'); + $existingGroup2 = $this->getMock('OCP\IGroup'); $existingGroup1 ->expects($this->once()) ->method('addUser') @@ -624,7 +624,7 @@ class UsersTest extends OriginalTest { ['Added userid NewUser to group ExistingGroup1', ['app' => 'ocs_api']], ['Added userid NewUser to group ExistingGroup2', ['app' => 'ocs_api']] ); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $this->groupManager ->expects($this->once()) @@ -661,7 +661,7 @@ class UsersTest extends OriginalTest { } public function testGetUserTargetDoesNotExist() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -677,12 +677,12 @@ class UsersTest extends OriginalTest { } public function testGetUserAsAdmin() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') ->will($this->returnValue('admin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser->expects($this->once()) ->method('getEMailAddress') ->willReturn('demo@owncloud.org'); @@ -727,12 +727,12 @@ class UsersTest extends OriginalTest { } public function testGetUserAsSubAdminAndUserIsAccessible() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') ->will($this->returnValue('subadmin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser ->expects($this->once()) ->method('getEMailAddress') @@ -751,7 +751,7 @@ class UsersTest extends OriginalTest { ->method('isAdmin') ->with('subadmin') ->will($this->returnValue(false)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor() ->getMock(); $subAdminManager @@ -790,12 +790,12 @@ class UsersTest extends OriginalTest { } public function testGetUserAsSubAdminAndUserIsNotAccessible() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->exactly(2)) ->method('getUID') ->will($this->returnValue('subadmin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -810,7 +810,7 @@ class UsersTest extends OriginalTest { ->method('isAdmin') ->with('subadmin') ->will($this->returnValue(false)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor() ->getMock(); $subAdminManager @@ -828,12 +828,12 @@ class UsersTest extends OriginalTest { } public function testGetUserAsSubAdminSelfLookup() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->exactly(2)) ->method('getUID') ->will($this->returnValue('subadmin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -848,7 +848,7 @@ class UsersTest extends OriginalTest { ->method('isAdmin') ->with('subadmin') ->will($this->returnValue(false)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor() ->getMock(); $subAdminManager @@ -893,12 +893,12 @@ class UsersTest extends OriginalTest { } public function testEditUserRegularUserSelfEditChangeDisplayName() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('UserToEdit')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -918,12 +918,12 @@ class UsersTest extends OriginalTest { } public function testEditUserRegularUserSelfEditChangeEmailValid() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('UserToEdit')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -943,12 +943,12 @@ class UsersTest extends OriginalTest { } public function testEditUserRegularUserSelfEditChangeEmailInvalid() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('UserToEdit')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -964,12 +964,12 @@ class UsersTest extends OriginalTest { } public function testEditUserRegularUserSelfEditChangePassword() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('UserToEdit')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -989,12 +989,12 @@ class UsersTest extends OriginalTest { } public function testEditUserRegularUserSelfEditChangeQuota() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('UserToEdit')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -1010,12 +1010,12 @@ class UsersTest extends OriginalTest { } public function testEditUserAdminUserSelfEditChangeValidQuota() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('UserToEdit')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser->expects($this->once()) ->method('setQuota') ->with('2.9 MB'); @@ -1039,12 +1039,12 @@ class UsersTest extends OriginalTest { } public function testEditUserAdminUserSelfEditChangeInvalidQuota() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('UserToEdit')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -1065,12 +1065,12 @@ class UsersTest extends OriginalTest { } public function testEditUserAdminUserEditChangeValidQuota() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('admin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser->expects($this->once()) ->method('setQuota') ->with('2.9 MB'); @@ -1088,7 +1088,7 @@ class UsersTest extends OriginalTest { ->method('isAdmin') ->with('admin') ->will($this->returnValue(true)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor() ->getMock(); $this->groupManager @@ -1101,12 +1101,12 @@ class UsersTest extends OriginalTest { } public function testEditUserSubadminUserAccessible() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('subadmin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser->expects($this->once()) ->method('setQuota') ->with('2.9 MB'); @@ -1119,7 +1119,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('UserToEdit') ->will($this->returnValue($targetUser)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor() ->getMock(); $subAdminManager @@ -1137,12 +1137,12 @@ class UsersTest extends OriginalTest { } public function testEditUserSubadminUserInaccessible() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('subadmin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -1152,7 +1152,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('UserToEdit') ->will($this->returnValue($targetUser)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor() ->getMock(); $subAdminManager @@ -1180,7 +1180,7 @@ class UsersTest extends OriginalTest { } public function testDeleteUserNotExistingUser() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') @@ -1200,12 +1200,12 @@ class UsersTest extends OriginalTest { } public function testDeleteUserSelf() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('UserToDelete')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser ->expects($this->once()) ->method('getUID') @@ -1225,12 +1225,12 @@ class UsersTest extends OriginalTest { } public function testDeleteSuccessfulUserAsAdmin() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('admin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser ->expects($this->once()) ->method('getUID') @@ -1259,12 +1259,12 @@ class UsersTest extends OriginalTest { } public function testDeleteUnsuccessfulUserAsAdmin() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('admin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser ->expects($this->once()) ->method('getUID') @@ -1293,12 +1293,12 @@ class UsersTest extends OriginalTest { } public function testDeleteSuccessfulUserAsSubadmin() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('subadmin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser ->expects($this->once()) ->method('getUID') @@ -1317,7 +1317,7 @@ class UsersTest extends OriginalTest { ->method('isAdmin') ->with('subadmin') ->will($this->returnValue(false)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -1338,12 +1338,12 @@ class UsersTest extends OriginalTest { } public function testDeleteUnsuccessfulUserAsSubadmin() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('subadmin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser ->expects($this->once()) ->method('getUID') @@ -1362,7 +1362,7 @@ class UsersTest extends OriginalTest { ->method('isAdmin') ->with('subadmin') ->will($this->returnValue(false)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -1383,12 +1383,12 @@ class UsersTest extends OriginalTest { } public function testDeleteUserAsSubAdminAndUserIsNotAccessible() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('subadmin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser ->expects($this->once()) ->method('getUID') @@ -1407,7 +1407,7 @@ class UsersTest extends OriginalTest { ->method('isAdmin') ->with('subadmin') ->will($this->returnValue(false)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -1434,7 +1434,7 @@ class UsersTest extends OriginalTest { } public function testGetUsersGroupsTargetUserNotExisting() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -1445,12 +1445,12 @@ class UsersTest extends OriginalTest { } public function testGetUsersGroupsSelfTargetted() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') ->will($this->returnValue('UserToLookup')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser ->expects($this->once()) ->method('getUID') @@ -1475,12 +1475,12 @@ class UsersTest extends OriginalTest { } public function testGetUsersGroupsForAdminUser() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->exactly(2)) ->method('getUID') ->will($this->returnValue('admin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser ->expects($this->once()) ->method('getUID') @@ -1510,12 +1510,12 @@ class UsersTest extends OriginalTest { } public function testGetUsersGroupsForSubAdminUserAndUserIsAccessible() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->exactly(2)) ->method('getUID') ->will($this->returnValue('subadmin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser ->expects($this->once()) ->method('getUID') @@ -1534,7 +1534,7 @@ class UsersTest extends OriginalTest { ->method('isAdmin') ->with('subadmin') ->will($this->returnValue(false)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -1545,12 +1545,12 @@ class UsersTest extends OriginalTest { ->expects($this->once()) ->method('getSubAdmin') ->will($this->returnValue($subAdminManager)); - $group1 = $this->getMock('\OCP\IGroup'); + $group1 = $this->getMock('OCP\IGroup'); $group1 ->expects($this->any()) ->method('getGID') ->will($this->returnValue('Group1')); - $group2 = $this->getMock('\OCP\IGroup'); + $group2 = $this->getMock('OCP\IGroup'); $group2 ->expects($this->any()) ->method('getGID') @@ -1572,12 +1572,12 @@ class UsersTest extends OriginalTest { public function testGetUsersGroupsForSubAdminUserAndUserIsInaccessible() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->exactly(2)) ->method('getUID') ->will($this->returnValue('subadmin')); - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser ->expects($this->once()) ->method('getUID') @@ -1596,7 +1596,7 @@ class UsersTest extends OriginalTest { ->method('isAdmin') ->with('subadmin') ->will($this->returnValue(false)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -1630,7 +1630,7 @@ class UsersTest extends OriginalTest { public function testAddToGroupWithTargetGroupNotExisting() { $_POST['groupid'] = 'GroupToAddTo'; - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -1655,7 +1655,7 @@ class UsersTest extends OriginalTest { } public function testAddToGroupWithNoGroupSpecified() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -1677,12 +1677,12 @@ class UsersTest extends OriginalTest { public function testAddToGroupWithTargetUserNotExisting() { $_POST['groupid'] = 'GroupToAddTo'; - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') ->will($this->returnValue('admin')); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetGroup = $this->getMock('OCP\IGroup'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -1705,7 +1705,7 @@ class UsersTest extends OriginalTest { public function testAddToGroupWithoutPermission() { $_POST['groupid'] = 'GroupToAddTo'; - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') @@ -1735,7 +1735,7 @@ class UsersTest extends OriginalTest { } public function testRemoveFromGroupWithNoTargetGroup() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -1745,7 +1745,7 @@ class UsersTest extends OriginalTest { } public function testRemoveFromGroupWithNotExistingTargetGroup() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -1761,8 +1761,8 @@ class UsersTest extends OriginalTest { } public function testRemoveFromGroupWithNotExistingTargetUser() { - $loggedInUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $loggedInUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -1783,13 +1783,13 @@ class UsersTest extends OriginalTest { } public function testRemoveFromGroupWithoutPermission() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->once()) ->method('getUID') ->will($this->returnValue('unauthorizedUser')); - $targetUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -1804,7 +1804,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('TargetUser') ->will($this->returnValue($targetUser)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $this->groupManager ->expects($this->once()) @@ -1821,13 +1821,13 @@ class UsersTest extends OriginalTest { } public function testRemoveFromGroupAsAdminFromAdmin() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('admin')); - $targetUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $targetGroup ->expects($this->once()) ->method('getGID') @@ -1846,7 +1846,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('admin') ->will($this->returnValue($targetUser)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $this->groupManager ->expects($this->once()) @@ -1863,13 +1863,13 @@ class UsersTest extends OriginalTest { } public function testRemoveFromGroupAsSubAdminFromSubAdmin() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('subadmin')); - $targetUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $targetGroup ->expects($this->any()) ->method('getGID') @@ -1888,7 +1888,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('subadmin') ->will($this->returnValue($targetUser)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -1915,13 +1915,13 @@ class UsersTest extends OriginalTest { } public function testRemoveFromGroupSuccessful() { - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->any()) ->method('getUID') ->will($this->returnValue('admin')); - $targetUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $this->userSession ->expects($this->once()) ->method('getUser') @@ -1936,7 +1936,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('AnotherUser') ->will($this->returnValue($targetUser)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $this->groupManager ->expects($this->once()) @@ -1970,7 +1970,7 @@ class UsersTest extends OriginalTest { public function testAddSubAdminWithNotExistingTargetGroup() { $_POST['groupid'] = 'NotExistingGroup'; - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $this->userManager ->expects($this->once()) ->method('get') @@ -1989,8 +1989,8 @@ class UsersTest extends OriginalTest { public function testAddSubAdminToAdminGroup() { $_POST['groupid'] = 'ADmiN'; - $targetUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $this->userManager ->expects($this->once()) ->method('get') @@ -2009,8 +2009,8 @@ class UsersTest extends OriginalTest { public function testAddSubAdminTwice() { $_POST['groupid'] = 'TargetGroup'; - $targetUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $this->userManager ->expects($this->once()) ->method('get') @@ -2021,7 +2021,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('TargetGroup') ->will($this->returnValue($targetGroup)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -2040,8 +2040,8 @@ class UsersTest extends OriginalTest { public function testAddSubAdminSuccessful() { $_POST['groupid'] = 'TargetGroup'; - $targetUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $this->userManager ->expects($this->once()) ->method('get') @@ -2052,7 +2052,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('TargetGroup') ->will($this->returnValue($targetGroup)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -2076,8 +2076,8 @@ class UsersTest extends OriginalTest { public function testAddSubAdminUnsuccessful() { $_POST['groupid'] = 'TargetGroup'; - $targetUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $this->userManager ->expects($this->once()) ->method('get') @@ -2088,7 +2088,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('TargetGroup') ->will($this->returnValue($targetGroup)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -2121,7 +2121,7 @@ class UsersTest extends OriginalTest { } public function testRemoveSubAdminNotExistingTargetGroup() { - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $this->userManager ->expects($this->once()) ->method('get') @@ -2138,8 +2138,8 @@ class UsersTest extends OriginalTest { } public function testRemoveSubAdminFromNotASubadmin() { - $targetUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $this->userManager ->expects($this->once()) ->method('get') @@ -2150,7 +2150,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('GroupToDeleteFrom') ->will($this->returnValue($targetGroup)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -2167,8 +2167,8 @@ class UsersTest extends OriginalTest { } public function testRemoveSubAdminSuccessful() { - $targetUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $this->userManager ->expects($this->once()) ->method('get') @@ -2179,7 +2179,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('GroupToDeleteFrom') ->will($this->returnValue($targetGroup)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -2201,8 +2201,8 @@ class UsersTest extends OriginalTest { } public function testRemoveSubAdminUnsuccessful() { - $targetUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $this->userManager ->expects($this->once()) ->method('get') @@ -2213,7 +2213,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('GroupToDeleteFrom') ->will($this->returnValue($targetGroup)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -2246,8 +2246,8 @@ class UsersTest extends OriginalTest { } public function testGetUserSubAdminGroupsWithGroups() { - $targetUser = $this->getMock('\OCP\IUser'); - $targetGroup = $this->getMock('\OCP\IGroup'); + $targetUser = $this->getMock('OCP\IUser'); + $targetGroup = $this->getMock('OCP\IGroup'); $targetGroup ->expects($this->once()) ->method('getGID') @@ -2257,7 +2257,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('RequestedUser') ->will($this->returnValue($targetUser)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -2274,13 +2274,13 @@ class UsersTest extends OriginalTest { } public function testGetUserSubAdminGroupsWithoutGroups() { - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $this->userManager ->expects($this->once()) ->method('get') ->with('RequestedUser') ->will($this->returnValue($targetUser)); - $subAdminManager = $this->getMockBuilder('\OC\Subadmin') + $subAdminManager = $this->getMockBuilder('OC\SubAdmin') ->disableOriginalConstructor()->getMock(); $subAdminManager ->expects($this->once()) @@ -2297,7 +2297,7 @@ class UsersTest extends OriginalTest { } public function testEnableUser() { - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser->expects($this->once()) ->method('setEnabled') ->with(true); @@ -2306,7 +2306,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('RequestedUser') ->will($this->returnValue($targetUser)); - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->exactly(2)) ->method('getUID') @@ -2325,7 +2325,7 @@ class UsersTest extends OriginalTest { } public function testDisableUser() { - $targetUser = $this->getMock('\OCP\IUser'); + $targetUser = $this->getMock('OCP\IUser'); $targetUser->expects($this->once()) ->method('setEnabled') ->with(false); @@ -2334,7 +2334,7 @@ class UsersTest extends OriginalTest { ->method('get') ->with('RequestedUser') ->will($this->returnValue($targetUser)); - $loggedInUser = $this->getMock('\OCP\IUser'); + $loggedInUser = $this->getMock('OCP\IUser'); $loggedInUser ->expects($this->exactly(2)) ->method('getUID') |