diff options
author | Joas Schilling <coding@schilljs.com> | 2024-09-20 10:23:47 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-09-20 10:23:47 +0200 |
commit | 0e07c310a17bdc55a41e00c29b10a579e1b5c423 (patch) | |
tree | 3c60e394bb5621f0426aacee000ff16cb7116031 /apps/updatenotification | |
parent | 4ba3d4a31a5a27a7fad6b8928d899ec7247289ca (diff) | |
download | nextcloud-server-0e07c310a17bdc55a41e00c29b10a579e1b5c423.tar.gz nextcloud-server-0e07c310a17bdc55a41e00c29b10a579e1b5c423.zip |
fix(ci): Remove more withConsecutive in appsbugfix/noid/remove-more-withConsecutive
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/updatenotification')
-rw-r--r-- | apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php b/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php index dccccf1a940..3ebeb3d805d 100644 --- a/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php +++ b/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php @@ -93,14 +93,10 @@ class UpdateAvailableNotificationsTest extends TestCase { $this->config->expects($this->exactly(2)) ->method('getSystemValueBool') - ->withConsecutive( - ['has_internet_connection', true], - ['debug', false], - ) - ->willReturnOnConsecutiveCalls( - true, - true, - ); + ->willReturnMap([ + ['has_internet_connection', true, true], + ['debug', false, true], + ]); self::invokePrivate($job, 'run', [null]); } @@ -224,7 +220,7 @@ class UpdateAvailableNotificationsTest extends TestCase { ['app2', '1.9.2'], ], [ - ['app2', '1.9.2'], + ['app2', '1.9.2', ''], ], ], ]; @@ -251,9 +247,14 @@ class UpdateAvailableNotificationsTest extends TestCase { ->method('isUpdateAvailable') ->willReturnMap($isUpdateAvailable); - $mockedMethod = $job->expects($this->exactly(\count($notifications))) - ->method('createNotifications'); - \call_user_func_array([$mockedMethod, 'withConsecutive'], $notifications); + $i = 0; + $job->expects($this->exactly(\count($notifications))) + ->method('createNotifications') + ->willReturnCallback(function () use ($notifications, &$i) { + $this->assertEquals($notifications[$i], func_get_args()); + $i++; + }); + self::invokePrivate($job, 'checkAppUpdates'); } @@ -331,10 +332,9 @@ class UpdateAvailableNotificationsTest extends TestCase { ->willReturnSelf(); if ($userNotifications !== null) { - $mockedMethod = $notification->expects($this->exactly(\count($userNotifications))) + $notification->expects($this->exactly(\count($userNotifications))) ->method('setUser') ->willReturnSelf(); - \call_user_func_array([$mockedMethod, 'withConsecutive'], $userNotifications); $this->notificationManager->expects($this->exactly(\count($userNotifications))) ->method('notify'); |