test(background-jobs): cover string-bound Snowflake job IDs

Assisted-By: Copilot:GPT-5.6

Signed-off-by: Josh <josh.t.richards@gmail.com>
pull/62425/head
Josh 4 weeks ago committed by GitHub
parent c41c522987
commit db16d334a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 20
      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();

Loading…
Cancel
Save