MCPcopy Create free account
hub / github.com/taskforcesh/bullmq / testCanGetCountsPerPriority

Method testCanGetCountsPerPriority

php/tests/QueueTest.php:240–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

238 }
239
240 public function testCanGetCountsPerPriority(): void
241 {
242 // Add jobs with different priorities
243 for ($i = 0; $i < 12; $i++) {
244 $this->queue->add('priority-job', ['idx' => $i], [
245 'priority' => $i % 4,
246 ]);
247 }
248
249 $counts = $this->queue->getCountsPerPriority([0, 1, 2, 3]);
250
251 $this->assertArrayHasKey(0, $counts);
252 $this->assertArrayHasKey(1, $counts);
253 $this->assertArrayHasKey(2, $counts);
254 $this->assertArrayHasKey(3, $counts);
255 $this->assertEquals(3, $counts[0]);
256 $this->assertEquals(3, $counts[1]);
257 $this->assertEquals(3, $counts[2]);
258 $this->assertEquals(3, $counts[3]);
259 }
260
261 public function testCanPromoteDelayedJobs(): void
262 {

Callers

nothing calls this directly

Calls 2

addMethod · 0.65
getCountsPerPriorityMethod · 0.65

Tested by

no test coverage detected