diff --git a/src/Illuminate/Support/Testing/Fakes/QueueFake.php b/src/Illuminate/Support/Testing/Fakes/QueueFake.php index 7428b871ad6f..66d191e90c95 100644 --- a/src/Illuminate/Support/Testing/Fakes/QueueFake.php +++ b/src/Illuminate/Support/Testing/Fakes/QueueFake.php @@ -239,8 +239,8 @@ public function pop($queue = null) */ public function bulk($jobs, $data = '', $queue = null) { - foreach ($this->jobs as $job) { - $this->push($job); + foreach ($jobs as $job) { + $this->push($job, $data, $queue); } } diff --git a/tests/Support/SupportTestingQueueFakeTest.php b/tests/Support/SupportTestingQueueFakeTest.php index 1e14ff3af2f2..495bb0684d3e 100644 --- a/tests/Support/SupportTestingQueueFakeTest.php +++ b/tests/Support/SupportTestingQueueFakeTest.php @@ -87,6 +87,20 @@ public function testAssertNothingPushed() $this->assertThat($e, new ExceptionMessage('Jobs were pushed unexpectedly.')); } } + + public function testAssertPushedUsingBulk() + { + $this->fake->assertNothingPushed(); + + $queue = 'my-test-queue'; + $this->fake->bulk([ + $this->job, + new JobStub(), + ], null, $queue); + + $this->fake->assertPushedOn($queue, JobStub::class); + $this->fake->assertPushed(JobStub::class, 2); + } } class JobStub