summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/tests/Controller
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-01-29 10:38:05 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-01-29 20:47:35 +0100
commit15abcff2a199f9d80baabbc39778765a2458acd2 (patch)
treec535c00106a36d2b9b4a225172da1939ee100779 /apps/provisioning_api/tests/Controller
parent754932c7569f61fddd152151fcdcae6dbce9e834 (diff)
downloadnextcloud-server-15abcff2a199f9d80baabbc39778765a2458acd2.tar.gz
nextcloud-server-15abcff2a199f9d80baabbc39778765a2458acd2.zip
Expose subadmin to OCP
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/provisioning_api/tests/Controller')
-rw-r--r--apps/provisioning_api/tests/Controller/UsersControllerTest.php76
1 files changed, 0 insertions, 76 deletions
diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
index 0d6d811acbc..fcdc68d353b 100644
--- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
@@ -2738,44 +2738,6 @@ class UsersControllerTest extends TestCase {
/**
* @expectedException \OCP\AppFramework\OCS\OCSException
- * @expectedExceptionCode 103
- * @expectedExceptionMessage Unknown error occurred
- */
- public function testAddSubAdminUnsuccessful() {
- $targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
- $targetGroup = $this->getMockBuilder('\OCP\IGroup')->disableOriginalConstructor()->getMock();
- $this->userManager
- ->expects($this->once())
- ->method('get')
- ->with('ExistingUser')
- ->will($this->returnValue($targetUser));
- $this->groupManager
- ->expects($this->once())
- ->method('get')
- ->with('TargetGroup')
- ->will($this->returnValue($targetGroup));
- $subAdminManager = $this->getMockBuilder('OC\SubAdmin')
- ->disableOriginalConstructor()->getMock();
- $subAdminManager
- ->expects($this->once())
- ->method('isSubAdminOfGroup')
- ->with($targetUser, $targetGroup)
- ->will($this->returnValue(false));
- $subAdminManager
- ->expects($this->once())
- ->method('createSubAdmin')
- ->with($targetUser, $targetGroup)
- ->will($this->returnValue(false));
- $this->groupManager
- ->expects($this->once())
- ->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
-
- $this->api->addSubAdmin('ExistingUser', 'TargetGroup');
- }
-
- /**
- * @expectedException \OCP\AppFramework\OCS\OCSException
* @expectedExceptionCode 101
* @expectedExceptionMessage User does not exist
*/
@@ -2879,44 +2841,6 @@ class UsersControllerTest extends TestCase {
/**
* @expectedException \OCP\AppFramework\OCS\OCSException
- * @expectedExceptionCode 103
- * @expectedExceptionMessage Unknown error occurred
- */
- public function testRemoveSubAdminUnsuccessful() {
- $targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
- $targetGroup = $this->getMockBuilder('\OCP\IGroup')->disableOriginalConstructor()->getMock();
- $this->userManager
- ->expects($this->once())
- ->method('get')
- ->with('ExistingUser')
- ->will($this->returnValue($targetUser));
- $this->groupManager
- ->expects($this->once())
- ->method('get')
- ->with('GroupToDeleteFrom')
- ->will($this->returnValue($targetGroup));
- $subAdminManager = $this->getMockBuilder('OC\SubAdmin')
- ->disableOriginalConstructor()->getMock();
- $subAdminManager
- ->expects($this->once())
- ->method('isSubAdminOfGroup')
- ->with($targetUser, $targetGroup)
- ->will($this->returnValue(true));
- $subAdminManager
- ->expects($this->once())
- ->method('deleteSubAdmin')
- ->with($targetUser, $targetGroup)
- ->will($this->returnValue(false));
- $this->groupManager
- ->expects($this->once())
- ->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
-
- $this->api->removeSubAdmin('ExistingUser', 'GroupToDeleteFrom');
- }
-
- /**
- * @expectedException \OCP\AppFramework\OCS\OCSException
* @expectedExceptionCode 404
* @expectedExceptionMessage User does not exist
*/