aboutsummaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api
diff options
context:
space:
mode:
authorJulien Veyssier <eneiluj@posteo.net>2021-07-30 16:32:08 +0200
committerJulien Veyssier <eneiluj@posteo.net>2021-07-30 16:32:08 +0200
commit7cc1b62883594bc7f28bdbc3d83fdca721058c51 (patch)
tree9696adef80f64b07127c5b7a0f9656de29375541 /apps/provisioning_api
parent7170c03f0e11a2f7385d909cd0b98f90e0ce984c (diff)
downloadnextcloud-server-7cc1b62883594bc7f28bdbc3d83fdca721058c51.tar.gz
nextcloud-server-7cc1b62883594bc7f28bdbc3d83fdca721058c51.zip
fix UserController tests failing because of max_quota app value not provided by mocks
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Diffstat (limited to 'apps/provisioning_api')
-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())