diff options
author | Joas Schilling <coding@schilljs.com> | 2024-09-24 07:00:19 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-09-25 08:35:19 +0200 |
commit | ec6ed0cf742a5e72fe1bdd135274af9aef1b2534 (patch) | |
tree | c7491951d262fdd821ebe06a674745c33b5136fd /apps | |
parent | 2ff103cb877aa2305590c343d6dee4e0b7d78a4d (diff) | |
download | nextcloud-server-ec6ed0cf742a5e72fe1bdd135274af9aef1b2534.tar.gz nextcloud-server-ec6ed0cf742a5e72fe1bdd135274af9aef1b2534.zip |
fix(tests): Make timing test more reliable
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_status/tests/Integration/Service/StatusServiceIntegrationTest.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/user_status/tests/Integration/Service/StatusServiceIntegrationTest.php b/apps/user_status/tests/Integration/Service/StatusServiceIntegrationTest.php index a035422087b..d979960f7c2 100644 --- a/apps/user_status/tests/Integration/Service/StatusServiceIntegrationTest.php +++ b/apps/user_status/tests/Integration/Service/StatusServiceIntegrationTest.php @@ -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 { |