From c9a5b528b59dc43512b39eae7aedcb31e26f4859 Mon Sep 17 00:00:00 2001 From: Kevin Bui Date: Sat, 13 Dec 2025 15:54:17 +1100 Subject: [PATCH 1/2] Remove the assertSentTimes method and add the hasMetadata method. --- mail.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mail.md b/mail.md index 45adc652b5..7dfb2b4318 100644 --- a/mail.md +++ b/mail.md @@ -1262,9 +1262,6 @@ test('orders can be shipped', function () { // Assert a mailable was not sent... Mail::assertNotSent(AnotherMailable::class); - // Assert a mailable was sent twice... - Mail::assertSentTimes(OrderShipped::class, 2); - // Assert 3 total mailables were sent... Mail::assertSentCount(3); }); @@ -1341,6 +1338,7 @@ Mail::assertSent(OrderShipped::class, function (OrderShipped $mail) use ($user) $mail->hasReplyTo('...') && $mail->hasFrom('...') && $mail->hasSubject('...') && + $mail->hasMetadata('order_id', $mail->order->id) && $mail->usesMailer('ses'); }); ``` From 2e30d818028824601458debe3aad871ae5e101b4 Mon Sep 17 00:00:00 2001 From: Kevin Bui Date: Sat, 13 Dec 2025 16:15:44 +1100 Subject: [PATCH 2/2] also remove the assertSentTimes method for the PHPUnit tab. --- mail.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/mail.md b/mail.md index 7dfb2b4318..6789aa3721 100644 --- a/mail.md +++ b/mail.md @@ -1302,9 +1302,6 @@ class ExampleTest extends TestCase // Assert a mailable was not sent... Mail::assertNotSent(AnotherMailable::class); - // Assert a mailable was sent twice... - Mail::assertSentTimes(OrderShipped::class, 2); - // Assert 3 total mailables were sent... Mail::assertSentCount(3); }