Skip to content

Commit a98b908

Browse files
committed
SchedulerTest - easier assert
1 parent 16b2d72 commit a98b908

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/PHPStan/Parallel/SchedulerTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ public function testSchedule(
5555
$schedule = $scheduler->scheduleWork($cpuCores, $files);
5656

5757
$this->assertSame($expectedNumberOfProcesses, $schedule->getNumberOfProcesses());
58-
$this->assertCount(count($expectedJobSizes), $schedule->getJobs());
59-
foreach ($expectedJobSizes as $i => $expectedJobSize) {
60-
$scheduledJob = $schedule->getJobs()[$i];
61-
$this->assertCount($expectedJobSize, $scheduledJob);
62-
}
58+
$jobSizes = array_map(static function (array $job): int {
59+
return count($job);
60+
}, $schedule->getJobs());
61+
$this->assertSame($expectedJobSizes, $jobSizes);
6362
}
6463

6564
}

0 commit comments

Comments
 (0)