From a80c77a2a6cbd43c031551903e2f2848ffe80c90 Mon Sep 17 00:00:00 2001 From: Stephen Finney Date: Thu, 22 Mar 2018 13:54:43 -0400 Subject: [PATCH] First stab at #18 --- src/MailTracking.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/MailTracking.php b/src/MailTracking.php index b192dce..7960a3e 100644 --- a/src/MailTracking.php +++ b/src/MailTracking.php @@ -103,15 +103,19 @@ public function recordMail(Swift_Message $email) /** * Assert that the last email was bcc'ed to the given address. * - * @param string $bcc + * @param string|array $bcc_list The BCC or array of BCCs to check * @param Swift_Message|null $message * * @return $this */ - protected function seeEmailBcc($bcc, Swift_Message $message = null) + protected function seeEmailBcc($bcc_list, Swift_Message $message = null) { - $this->assertArrayHasKey($bcc, (array)$this->getEmail($message) - ->getBcc(), "The last email sent was not bcc'ed to $bcc."); + if (! is_array($bcc_list)) { + $bcc_list = [$bcc_list]; + } + + $this->arrayHasKey((array)$this->getEmail($message) + ->getBcc(), $bcc_list, 'The last email sent was not bcc\'ed to any of the following addresses: ' . implode(', ', $bcc_list) . '.'); return $this; }