Skip to content

Commit 9be25aa

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

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
@@ -66,6 +66,7 @@ private function buildUpdateUrl(string $baseUrl, int $lastUpdateDate): string {
6666
}
6767

6868
public function testCheckInCache(): void {
69+
$time = time();
6970
$expectedResult = [
7071
'version' => '8.0.4.2',
7172
'versionstring' => 'ownCloud 8.0.4',
@@ -83,7 +84,7 @@ public function testCheckInCache(): void {
8384
->expects($this->once())
8485
->method('getValueInt')
8586
->with('core', 'lastupdatedat')
86-
->willReturn(time());
87+
->willReturn($time);
8788
$this->config
8889
->expects($this->once())
8990
->method('getAppValue')
@@ -284,7 +285,7 @@ public function testCheckWithEmptyInvalidXmlResponse(): void {
284285
->with('core', 'lastupdatedat')
285286
->willReturnOnConsecutiveCalls(
286287
0,
287-
time(),
288+
$lastUpdateDate,
288289
);
289290
$this->config
290291
->expects($this->exactly(2))
@@ -299,7 +300,7 @@ public function testCheckWithEmptyInvalidXmlResponse(): void {
299300
$this->appConfig
300301
->expects($this->once())
301302
->method('setValueInt')
302-
->with('core', 'lastupdatedat', time());
303+
->with('core', 'lastupdatedat', $lastUpdateDate);
303304
$this->config
304305
->expects($this->once())
305306
->method('setAppValue')

0 commit comments

Comments
 (0)