Skip to content

Commit 428b71b

Browse files
nickvergessenbackportbot[bot]
authored andcommitted
test(version-check): Fix flaky test
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent eb50885 commit 428b71b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/lib/Updater/VersionCheckTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ private function buildUpdateUrl(string $baseUrl, int $lastUpdateDate): string {
6565
}
6666

6767
public function testCheckInCache(): void {
68+
$time = time();
6869
$expectedResult = [
6970
'version' => '8.0.4.2',
7071
'versionstring' => 'ownCloud 8.0.4',
@@ -82,7 +83,7 @@ public function testCheckInCache(): void {
8283
->expects($this->once())
8384
->method('getValueInt')
8485
->with('core', 'lastupdatedat')
85-
->willReturn(time());
86+
->willReturn($time);
8687
$this->config
8788
->expects($this->once())
8889
->method('getAppValue')
@@ -283,7 +284,7 @@ public function testCheckWithEmptyInvalidXmlResponse(): void {
283284
->with('core', 'lastupdatedat')
284285
->willReturnOnConsecutiveCalls(
285286
0,
286-
time(),
287+
$lastUpdateDate,
287288
);
288289
$this->config
289290
->expects($this->exactly(2))
@@ -298,7 +299,7 @@ public function testCheckWithEmptyInvalidXmlResponse(): void {
298299
$this->appConfig
299300
->expects($this->once())
300301
->method('setValueInt')
301-
->with('core', 'lastupdatedat', time());
302+
->with('core', 'lastupdatedat', $lastUpdateDate);
302303
$this->config
303304
->expects($this->once())
304305
->method('setAppValue')

0 commit comments

Comments
 (0)