Skip to content

Commit

Permalink
Merge pull request #3502 from mateusjatenee/patch-4
Browse files Browse the repository at this point in the history
[5.5] Add documentation regarding QueueFake and MailFake
  • Loading branch information
taylorotwell authored Aug 13, 2017
2 parents e46b802 + 9639e3a commit d7198a8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ You may use the `Mail` facade's `fake` method to prevent mail from being sent. Y
$mail->hasCc('...') &&
$mail->hasBcc('...');
});
// Assert a mailable was sent twice...
Mail::assertSent(OrderShipped::class, 2);

// Assert a mailable was not sent...
Mail::assertNotSent(AnotherMailable::class);
Expand Down Expand Up @@ -199,6 +202,9 @@ As an alternative to mocking, you may use the `Queue` facade's `fake` method to

// Assert a job was pushed to a given queue...
Queue::assertPushedOn('queue-name', ShipOrder::class);
// Assert a job was pushed twice...
Queue::assertPushed(ShipOrder::class, 2);

// Assert a job was not pushed...
Queue::assertNotPushed(AnotherJob::class);
Expand Down

0 comments on commit d7198a8

Please sign in to comment.