diff options
author | Julien Veyssier <eneiluj@posteo.net> | 2021-08-23 19:00:59 +0200 |
---|---|---|
committer | Julien Veyssier <eneiluj@posteo.net> | 2021-08-23 19:00:59 +0200 |
commit | 6d2430701c9af8029da34140a9e2176b9e904f9c (patch) | |
tree | 6fd2c123ecfa5112be5ab4b634bfbe259c66650a /apps | |
parent | d84eed7fb0016d9b4a329aedde9af36a04901e1e (diff) | |
download | nextcloud-server-6d2430701c9af8029da34140a9e2176b9e904f9c.tar.gz nextcloud-server-6d2430701c9af8029da34140a9e2176b9e904f9c.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')
-rw-r--r-- | apps/provisioning_api/tests/Controller/UsersControllerTest.php | 27 |
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()) |