Skip to content

Commit 4e63726

Browse files
committed
[12.x] Test
1 parent 897e546 commit 4e63726

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/Integration/Queue/JobChainingTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,25 @@ public function testBatchCanBeAddedToChain()
396396
$this->assertEquals(['c1', 'c2', 'b1', 'b2', 'b3', 'b4', 'c3'], JobRunRecorder::$results);
397397
}
398398

399+
public function testBatchInChainUsesCorrectQueue()
400+
{
401+
Bus::chain([
402+
(new JobChainingNamedTestJob('c1'))->onQueue('other'),
403+
(new JobChainingNamedTestJob('c2'))->onQueue('other'),
404+
Bus::batch([
405+
new JobChainingTestBatchedJob('b1'),
406+
new JobChainingTestBatchedJob('b2'),
407+
new JobChainingTestBatchedJob('b3'),
408+
new JobChainingTestBatchedJob('b4'),
409+
])->onQueue('other'),
410+
(new JobChainingNamedTestJob('c3'))->onQueue('other'),
411+
])->dispatch();
412+
413+
$this->runQueueWorkerCommand(['--queue' => 'other', '--stop-when-empty' => true]);
414+
415+
$this->assertEquals(['c1', 'c2', 'b1', 'b2', 'b3', 'b4', 'c3'], JobRunRecorder::$results);
416+
}
417+
399418
public function testDynamicBatchCanBeAddedToChain()
400419
{
401420
Bus::chain([

0 commit comments

Comments
 (0)