diff options
Diffstat (limited to 'apps/provisioning_api/tests/Controller/UsersControllerTest.php')
-rw-r--r-- | apps/provisioning_api/tests/Controller/UsersControllerTest.php | 76 |
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 */ |