summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/tests
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-03-23 18:24:03 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-04-05 17:09:00 +0200
commitb023bfe38fa7802de7efb42bb9ee11b81d73b7a7 (patch)
tree3f766bdaf551cfd02b89ba63538206e47eaab592 /apps/provisioning_api/tests
parent4011ea97b1a8553ecced4110f1d6d46268a52979 (diff)
downloadnextcloud-server-b023bfe38fa7802de7efb42bb9ee11b81d73b7a7.tar.gz
nextcloud-server-b023bfe38fa7802de7efb42bb9ee11b81d73b7a7.zip
Fixed tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/provisioning_api/tests')
-rw-r--r--apps/provisioning_api/tests/Controller/GroupsControllerTest.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php
index 352264c7afb..9108e2e3312 100644
--- a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php
@@ -40,6 +40,8 @@ class GroupsControllerTest extends \Test\TestCase {
protected $userSession;
/** @var \OC\SubAdmin|\PHPUnit_Framework_MockObject_MockObject */
protected $subAdminManager;
+ /** @var OCA\Provisioning_API\Controller\UsersController|\PHPUnit_Framework_MockObject_MockObject */
+ protected $userController;
/** @var GroupsController */
protected $api;
@@ -67,12 +69,17 @@ class GroupsControllerTest extends \Test\TestCase {
$logger = $this->createMock(ILogger::class);
+ $this->userController = $this->getMockBuilder('OCA\Provisioning_API\Controller\UsersController')
+ ->disableOriginalConstructor()
+ ->getMock();
+
$this->api = new GroupsController(
'provisioning_api',
$request,
$this->groupManager,
$this->userSession,
- $logger
+ $logger,
+ $this->userController
);
}
@@ -141,10 +148,10 @@ class GroupsControllerTest extends \Test\TestCase {
public function dataGetGroups() {
return [
- [null, null, null],
- ['foo', null, null],
- [null, 1, null],
- [null, null, 2],
+ [null, 0, 0],
+ ['foo', 0, 0],
+ [null, 1, 0],
+ [null, 0, 2],
['foo', 1, 2],
];
}
@@ -224,7 +231,7 @@ class GroupsControllerTest extends \Test\TestCase {
/**
* @expectedException \OCP\AppFramework\OCS\OCSException
- * @expectedExceptionCode 997
+ * @expectedExceptionCode 403
*/
public function testGetGroupAsIrrelevantSubadmin() {
$group = $this->createGroup('group');
@@ -269,7 +276,7 @@ class GroupsControllerTest extends \Test\TestCase {
/**
* @expectedException \OCP\AppFramework\OCS\OCSException
- * @expectedExceptionCode 998
+ * @expectedExceptionCode 404
* @expectedExceptionMessage The requested group could not be found
*/
public function testGetGroupNonExisting() {