Fix BackgroundJob list tests

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2023-01-12 11:40:18 +01:00
parent 679682c186
commit 75fca38e66
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -54,7 +54,12 @@ class JobListTest extends TestCase {
}
protected function getAllSorted() {
$jobs = $this->instance->getAll();
$iterator = $this->instance->getJobs(null, null, 0);
$jobs = [];
foreach ($iterator as $job) {
$jobs[] = clone $job;
}
usort($jobs, function (IJob $job1, IJob $job2) {
return $job1->getId() - $job2->getId();