diff options
author | Christopher Ng <chrng8@gmail.com> | 2023-08-10 19:07:53 -0700 |
---|---|---|
committer | Christopher Ng <chrng8@gmail.com> | 2023-08-11 16:31:36 -0700 |
commit | 6dc9438eeeb19b03f58c2e80249e58e663545fd9 (patch) | |
tree | 06d3ab1123c54517f3fb1ea9b5ed4837c538523e /apps/updatenotification | |
parent | 0c3324f478d54a062d3d27529c870c8f095d5cd3 (diff) | |
download | nextcloud-server-6dc9438eeeb19b03f58c2e80249e58e663545fd9.tar.gz nextcloud-server-6dc9438eeeb19b03f58c2e80249e58e663545fd9.zip |
test(updatenotification): No internet
Signed-off-by: Christopher Ng <chrng8@gmail.com>
(cherry picked from commit de4bc44f956cf51bcd01fa3ac01fc8824dc05eda)
Diffstat (limited to 'apps/updatenotification')
-rw-r--r-- | apps/updatenotification/tests/Notification/BackgroundJobTest.php | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/apps/updatenotification/tests/Notification/BackgroundJobTest.php b/apps/updatenotification/tests/Notification/BackgroundJobTest.php index df8b104e9ca..d669a5832b4 100644 --- a/apps/updatenotification/tests/Notification/BackgroundJobTest.php +++ b/apps/updatenotification/tests/Notification/BackgroundJobTest.php @@ -112,9 +112,34 @@ class BackgroundJobTest extends TestCase { $job->expects($this->once()) ->method('checkAppUpdates'); + $this->config->expects($this->exactly(2)) + ->method('getSystemValueBool') + ->withConsecutive( + ['has_internet_connection', true], + ['debug', false], + ) + ->willReturnOnConsecutiveCalls( + true, + true, + ); + + self::invokePrivate($job, 'run', [null]); + } + + public function testRunNoInternet() { + $job = $this->getJob([ + 'checkCoreUpdate', + 'checkAppUpdates', + ]); + + $job->expects($this->never()) + ->method('checkCoreUpdate'); + $job->expects($this->never()) + ->method('checkAppUpdates'); + $this->config->method('getSystemValueBool') - ->with('debug', false) - ->willReturn(true); + ->with('has_internet_connection', true) + ->willReturn(false); self::invokePrivate($job, 'run', [null]); } |