diff --git a/src/Illuminate/Support/Testing/Fakes/QueueFake.php b/src/Illuminate/Support/Testing/Fakes/QueueFake.php index 7cc36c3c8355..960a776eaea4 100644 --- a/src/Illuminate/Support/Testing/Fakes/QueueFake.php +++ b/src/Illuminate/Support/Testing/Fakes/QueueFake.php @@ -229,7 +229,7 @@ public function connection($value = null) */ public function size($queue = null) { - return 0; + return count($this->jobs); } /** diff --git a/tests/Support/SupportTestingQueueFakeTest.php b/tests/Support/SupportTestingQueueFakeTest.php index be3d0252d8ff..9b9fd40e815f 100644 --- a/tests/Support/SupportTestingQueueFakeTest.php +++ b/tests/Support/SupportTestingQueueFakeTest.php @@ -32,6 +32,15 @@ public function testAssertPushed() $this->fake->assertPushed(JobStub::class); } + public function testQueueSize() + { + $this->assertEquals(0, $this->fake->size()); + + $this->fake->push($this->job); + + $this->assertEquals(1, $this->fake->size()); + } + public function testAssertNotPushed() { $this->fake->assertNotPushed(JobStub::class);