Skip to content

Commit

Permalink
correct required type for findEmail() $to (#255)
Browse files Browse the repository at this point in the history
Follows same logic as thereIsAnEmailTitled() which sets the $to param of findEmail() to an empty string
  • Loading branch information
scott-nz authored Nov 14, 2023
1 parent 86c6c81 commit fdde721
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Context/EmailContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function before(BeforeScenarioScope $event)
*/
public function thereIsAnEmailFromTo($negate, $direction, $email)
{
$to = ($direction == 'to') ? $email : null;
$to = ($direction == 'to') ? $email : '';
$from = ($direction == 'from') ? $email : null;
$match = $this->mailer->findEmail($to, $from);
if (trim($negate ?? '')) {
Expand All @@ -84,7 +84,7 @@ public function thereIsAnEmailFromTo($negate, $direction, $email)
*/
public function thereIsAnEmailFromToTitled($negate, $direction, $email, $subject)
{
$to = ($direction == 'to') ? $email : null;
$to = ($direction == 'to') ? $email : '';
$from = ($direction == 'from') ? $email : null;
$match = $this->mailer->findEmail($to, $from, $subject);
$allMails = $this->mailer->findEmails($to, $from);
Expand Down

0 comments on commit fdde721

Please sign in to comment.