summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/tests
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-03-16 15:37:05 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-03-19 15:12:32 +0100
commit24659342f5e12903a252b50778179b1b558832ea (patch)
tree7e37fa8aa0ec72738d8caeec22c3e8c32e98a598 /apps/provisioning_api/tests
parent2493e9426db1528437c6055a54fdf0ed17914690 (diff)
downloadnextcloud-server-24659342f5e12903a252b50778179b1b558832ea.tar.gz
nextcloud-server-24659342f5e12903a252b50778179b1b558832ea.zip
fixup! Check if groups is array, return empty do not throw
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/provisioning_api/tests')
-rw-r--r--apps/provisioning_api/tests/Controller/UsersControllerTest.php33
1 files changed, 3 insertions, 30 deletions
diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
index 83be63c49a5..38e35988137 100644
--- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
@@ -765,7 +765,7 @@ class UsersControllerTest extends TestCase {
'storageLocation' => '/var/www/newtcloud/data/UID',
'lastLogin' => 1521191471000,
'backend' => 'Database',
- 'subadmins' => ['group3'],
+ 'subadmin' => ['group3'],
'quota' => ['DummyValue'],
'email' => 'demo@nextcloud.com',
'displayname' => 'Demo User',
@@ -880,7 +880,7 @@ class UsersControllerTest extends TestCase {
'storageLocation' => '/var/www/newtcloud/data/UID',
'lastLogin' => 1521191471000,
'backend' => 'Database',
- 'subadmins' => [],
+ 'subadmin' => [],
'quota' => ['DummyValue'],
'email' => 'demo@nextcloud.com',
'displayname' => 'Demo User',
@@ -1035,7 +1035,7 @@ class UsersControllerTest extends TestCase {
'storageLocation' => '/var/www/newtcloud/data/UID',
'lastLogin' => 1521191471000,
'backend' => 'Database',
- 'subadmins' => [],
+ 'subadmin' => [],
'quota' => ['DummyValue'],
'email' => 'subadmin@nextcloud.com',
'displayname' => 'Subadmin User',
@@ -2853,33 +2853,6 @@ class UsersControllerTest extends TestCase {
$this->assertEquals(['TargetGroup'], $this->api->getUserSubAdminGroups('RequestedUser')->getData());
}
- /**
- * @expectedException \OCP\AppFramework\OCS\OCSException
- * @expectedExceptionCode 102
- * @expectedExceptionMessage Unknown error occurred
- */
- public function testGetUserSubAdminGroupsWithoutGroups() {
- $targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
- $this->userManager
- ->expects($this->once())
- ->method('get')
- ->with('RequestedUser')
- ->will($this->returnValue($targetUser));
- $subAdminManager = $this->getMockBuilder('OC\SubAdmin')
- ->disableOriginalConstructor()->getMock();
- $subAdminManager
- ->expects($this->once())
- ->method('getSubAdminsGroups')
- ->with($targetUser)
- ->will($this->returnValue([]));
- $this->groupManager
- ->expects($this->once())
- ->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
-
- $this->api->getUserSubAdminGroups('RequestedUser');
- }
-
public function testEnableUser() {
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser->expects($this->once())