Skip to content

Commit

Permalink
Queue fake now correctly counts the number of jobs (#23933)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkuhl authored and taylorotwell committed Apr 25, 2018
1 parent 2991de5 commit 5fdb63b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Testing/Fakes/QueueFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function connection($value = null)
*/
public function size($queue = null)
{
return 0;
return count($this->jobs);
}

/**
Expand Down
9 changes: 9 additions & 0 deletions tests/Support/SupportTestingQueueFakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5fdb63b

Please sign in to comment.