@@ -540,6 +540,38 @@ public function testDispatchFakeBatch()
540
540
$ this ->assertSame ('' , $ batch ->name );
541
541
$ this ->assertSame (0 , $ batch ->totalJobs );
542
542
}
543
+
544
+ public function testIncrementFailedJobsInFakeBatch ()
545
+ {
546
+ $ this ->fake ->assertNothingBatched ();
547
+ $ batch = $ this ->fake ->dispatchFakeBatch ('my fake job batch ' );
548
+
549
+ $ this ->fake ->assertBatchCount (1 );
550
+ $ this ->assertInstanceOf (Batch::class, $ batch );
551
+ $ this ->assertSame ('my fake job batch ' , $ batch ->name );
552
+ $ this ->assertSame (0 , $ batch ->totalJobs );
553
+
554
+ $ batch ->incrementFailedJobs ($ batch ->id );
555
+
556
+ $ this ->assertSame (0 , $ batch ->failedJobs );
557
+ $ this ->assertSame (0 , $ batch ->pendingJobs );
558
+ }
559
+
560
+ public function testDecrementPendingJobsInFakeBatch ()
561
+ {
562
+ $ this ->fake ->assertNothingBatched ();
563
+ $ batch = $ this ->fake ->dispatchFakeBatch ('my fake job batch ' );
564
+
565
+ $ this ->fake ->assertBatchCount (1 );
566
+ $ this ->assertInstanceOf (Batch::class, $ batch );
567
+ $ this ->assertSame ('my fake job batch ' , $ batch ->name );
568
+ $ this ->assertSame (0 , $ batch ->totalJobs );
569
+
570
+ $ batch ->decrementPendingJobs ($ batch ->id );
571
+
572
+ $ this ->assertSame (0 , $ batch ->failedJobs );
573
+ $ this ->assertSame (0 , $ batch ->pendingJobs );
574
+ }
543
575
}
544
576
545
577
class BusJobStub
0 commit comments