summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2021-07-30 17:34:50 +0200
committerGitHub <noreply@github.com>2021-07-30 17:34:50 +0200
commita90bf7ed95d41d44eea9b64dc1447b801ab85d7a (patch)
tree98805ff8395ea7d677ce9e6549d379edc59f9e8b /apps
parent43e41ca5323388cc80c3179526d45544f6beb8f0 (diff)
parent7cc1b62883594bc7f28bdbc3d83fdca721058c51 (diff)
downloadnextcloud-server-a90bf7ed95d41d44eea9b64dc1447b801ab85d7a.tar.gz
nextcloud-server-a90bf7ed95d41d44eea9b64dc1447b801ab85d7a.zip
Merge pull request #28260 from nextcloud/fix/failing-user-controller-tests
fix UserController tests
Diffstat (limited to 'apps')
-rw-r--r--apps/provisioning_api/tests/Controller/UsersControllerTest.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
index 238bac34307..cc638c89a63 100644
--- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
@@ -1755,6 +1755,15 @@ class UsersControllerTest extends TestCase {
}
public function testEditUserAdminUserSelfEditChangeValidQuota() {
+ $this->config
+ ->expects($this->once())
+ ->method('getAppValue')
+ ->willReturnCallback(function ($appid, $key, $default) {
+ if ($key === 'max_quota') {
+ return '-1';
+ }
+ return null;
+ });
$loggedInUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$loggedInUser
->expects($this->any())
@@ -1834,6 +1843,15 @@ class UsersControllerTest extends TestCase {
}
public function testEditUserAdminUserEditChangeValidQuota() {
+ $this->config
+ ->expects($this->once())
+ ->method('getAppValue')
+ ->willReturnCallback(function ($appid, $key, $default) {
+ if ($key === 'max_quota') {
+ return '-1';
+ }
+ return null;
+ });
$loggedInUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$loggedInUser
->expects($this->any())
@@ -2082,6 +2100,15 @@ class UsersControllerTest extends TestCase {
}
public function testEditUserSubadminUserAccessible() {
+ $this->config
+ ->expects($this->once())
+ ->method('getAppValue')
+ ->willReturnCallback(function ($appid, $key, $default) {
+ if ($key === 'max_quota') {
+ return '-1';
+ }
+ return null;
+ });
$loggedInUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$loggedInUser
->expects($this->any())