Skip to content

Commit 0b67a6f

Browse files
authored
[9.x] Add test for assertChained in BusFake (#41867)
1 parent d927810 commit 0b67a6f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/Support/SupportTestingBusFakeTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Illuminate\Tests\Support;
44

5+
use Illuminate\Bus\Queueable;
56
use Illuminate\Contracts\Bus\QueueingDispatcher;
67
use Illuminate\Support\Testing\Fakes\BusFake;
78
use Mockery as m;
@@ -376,6 +377,19 @@ public function testAssertNothingDispatched()
376377
}
377378
}
378379

380+
public function testAssertChained()
381+
{
382+
$this->fake->chain([
383+
new ChainedJobStub,
384+
new OtherBusJobStub,
385+
])->dispatch();
386+
387+
$this->fake->assertChained([
388+
ChainedJobStub::class,
389+
OtherBusJobStub::class,
390+
]);
391+
}
392+
379393
public function testAssertDispatchedWithIgnoreClass()
380394
{
381395
$dispatcher = m::mock(QueueingDispatcher::class);
@@ -447,6 +461,11 @@ class BusJobStub
447461
//
448462
}
449463

464+
class ChainedJobStub
465+
{
466+
use Queueable;
467+
}
468+
450469
class OtherBusJobStub
451470
{
452471
public $id;

0 commit comments

Comments
 (0)