From db16d334a6cb2ed4e4b25661036a84b84cec2b46 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 22 Jul 2026 14:30:21 -0400 Subject: [PATCH] test(background-jobs): cover string-bound Snowflake job IDs Assisted-By: Copilot:GPT-5.6 Signed-off-by: Josh --- tests/lib/BackgroundJob/JobListTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/lib/BackgroundJob/JobListTest.php b/tests/lib/BackgroundJob/JobListTest.php index 249625684f5..6e0d2f321f3 100644 --- a/tests/lib/BackgroundJob/JobListTest.php +++ b/tests/lib/BackgroundJob/JobListTest.php @@ -273,6 +273,26 @@ class JobListTest extends TestCase { $this->assertLessThanOrEqual($timeEnd, $addedJob->getLastRun()); } + public function testRemoveByIdWithSnowflakeId(): void { + $this->instance->add(new TestJob(), 'remove-by-id'); + $job = $this->instance->getJobs(null, 1, 0)[0]; + + $this->instance->removeById($job->getId()); + + $this->assertNull($this->instance->getById($job->getId())); + } + + public function testResetBackgroundJobWithSnowflakeId(): void { + $this->instance->add(new TestJob(), 'reset'); + $job = $this->instance->getJobs(null, 1, 0)[0]; + + $this->instance->resetBackgroundJob($job); + + $row = $this->instance->getDetailsById($job->getId()); + $this->assertSame('0', (string)$row['last_run']); + $this->assertSame('0', (string)$row['reserved_at']); + } + public function testHasReservedJobs(): void { $this->clearJobsList();