mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(tests): Make timing test more reliable
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
2ff103cb87
commit
ec6ed0cf74
1 changed files with 4 additions and 1 deletions
|
|
@ -42,17 +42,20 @@ class StatusServiceIntegrationTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testCustomStatusMessageTimestamp(): void {
|
||||
$before = time();
|
||||
$this->service->setCustomMessage(
|
||||
'test123',
|
||||
'🍕',
|
||||
'Lunch',
|
||||
null,
|
||||
);
|
||||
$after = time();
|
||||
|
||||
$status = $this->service->findByUserId('test123');
|
||||
|
||||
self::assertSame('Lunch', $status->getCustomMessage());
|
||||
self::assertGreaterThanOrEqual(time(), $status->getStatusMessageTimestamp());
|
||||
self::assertGreaterThanOrEqual($before, $status->getStatusMessageTimestamp());
|
||||
self::assertLessThanOrEqual($after, $status->getStatusMessageTimestamp());
|
||||
}
|
||||
|
||||
public function testOnlineStatusKeepsMessageTimestamp(): void {
|
||||
|
|
|
|||
Loading…
Reference in a new issue