Skip to content

Commit

Permalink
Merge pull request #28260 from nextcloud/fix/failing-user-controller-…
Browse files Browse the repository at this point in the history
…tests

fix UserController tests
  • Loading branch information
ChristophWurst authored Jul 30, 2021
2 parents 43e41ca + 7cc1b62 commit a90bf7e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions apps/provisioning_api/tests/Controller/UsersControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,15 @@ public function testEditUserRegularUserSelfEditChangeQuota() {
}

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())
Expand Down Expand Up @@ -1834,6 +1843,15 @@ public function testEditUserAdminUserSelfEditChangeInvalidQuota() {
}

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())
Expand Down Expand Up @@ -2082,6 +2100,15 @@ public function testEditUserAdminEditChangeLanguageInvalidLanguage() {
}

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())
Expand Down

0 comments on commit a90bf7e

Please sign in to comment.