fix UserController tests failing because of max_quota app value not provided by mocks

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
pull/28260/head
Julien Veyssier 5 years ago
parent 7170c03f0e
commit 7cc1b62883
No known key found for this signature in database
GPG Key ID: 4141FEE162030638
  1. 27
      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())

Loading…
Cancel
Save