aboutsummaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-03-08 01:35:04 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2024-03-08 01:53:59 +0100
commit2c87fbf20761a8e427b42055c1714ceba200548d (patch)
tree70750793ea6613e1eebd8d36e3ff20bad3160c5e /apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php
parent27b09ce00a22dc9912d2931a892a1b6870d6b22c (diff)
downloadnextcloud-server-2c87fbf20761a8e427b42055c1714ceba200548d.tar.gz
nextcloud-server-2c87fbf20761a8e427b42055c1714ceba200548d.zip
fix(updatenotification): Adjust tests for changed IAppConfig
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php')
-rw-r--r--apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php40
1 files changed, 20 insertions, 20 deletions
diff --git a/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php b/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php
index fd9affc87b3..a271d6988fe 100644
--- a/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php
+++ b/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php
@@ -211,19 +211,19 @@ class UpdateAvailableNotificationsTest extends TestCase {
$job->expects($this->never())
->method('clearErrorNotifications');
- $this->config->expects($this->once())
- ->method('getAppValue')
- ->willReturn($errorDays);
- $this->config->expects($this->once())
- ->method('setAppValue')
- ->with('updatenotification', 'update_check_errors', $errorDays + 1);
+ $this->appConfig->expects($this->once())
+ ->method('getAppValueInt')
+ ->willReturn($errorDays ?? 0);
+ $this->appConfig->expects($this->once())
+ ->method('setAppValueInt')
+ ->with('update_check_errors', $errorDays + 1);
$job->expects($errorDays !== null ? $this->once() : $this->never())
->method('sendErrorNotifications')
->with($errorDays + 1);
} else {
- $this->config->expects($this->once())
- ->method('setAppValue')
- ->with('updatenotification', 'update_check_errors', 0);
+ $this->appConfig->expects($this->once())
+ ->method('setAppValueInt')
+ ->with('update_check_errors', 0);
$job->expects($this->once())
->method('clearErrorNotifications');
$job->expects($this->once())
@@ -302,15 +302,15 @@ class UpdateAvailableNotificationsTest extends TestCase {
'getUsersToNotify',
]);
- $this->config->expects($this->once())
- ->method('getAppValue')
- ->with('updatenotification', $app, false)
- ->willReturn($lastNotification);
+ $this->appConfig->expects($this->once())
+ ->method('getAppValueString')
+ ->with($app, '')
+ ->willReturn($lastNotification ? $lastNotification : '');
if ($lastNotification !== $version) {
- $this->config->expects($this->once())
- ->method('setAppValue')
- ->with('updatenotification', $app, $version);
+ $this->appConfig->expects($this->once())
+ ->method('setAppValueString')
+ ->with($app, $version);
}
if ($callDelete === false) {
@@ -386,10 +386,10 @@ class UpdateAvailableNotificationsTest extends TestCase {
public function testGetUsersToNotify(array $groups, array $groupUsers, array $expected) {
$job = $this->getJob();
- $this->config->expects($this->once())
- ->method('getAppValue')
- ->with('updatenotification', 'notify_groups', '["admin"]')
- ->willReturn(json_encode($groups));
+ $this->appConfig->expects($this->once())
+ ->method('getAppValueArray')
+ ->with('notify_groups', ['admin'])
+ ->willReturn($groups);
$groupMap = [];
foreach ($groupUsers as $gid => $uids) {