Level 1
I have found an answer.
We can specify which job to fake with Bus.
In this case the test will look like this:
class JobATest extends TestCase
{
use RefreshDatabase;
/** @test */
public function it_will_dispatch_job_b()
{
Bus::fake([JobB::class]);
JobA::dispatchSync();
// assertions related to JobA
Bus::assertDispatched(JobB::class, 1);
}
}
2 likes