Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Fix: trait method seeMessageFrom should work when from set with name
Browse files Browse the repository at this point in the history
  • Loading branch information
exls committed May 9, 2017
1 parent 3269c0b commit a0bee24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Testing/InteractsWithMail.php
Expand Up @@ -94,7 +94,9 @@ public function seeMessageFrom($email)
{
$this->seeMessage();

$from = $this->lastMessage()->from->first();
$from = $this->lastMessage()->from->map(function ($value, $key) {
return is_numeric($key) ? $value : $key;
})->first();

$this->assertEquals(
$email,
Expand Down
7 changes: 7 additions & 0 deletions tests/InteractsWithMailTest.php
Expand Up @@ -148,6 +148,13 @@ public function test_see_message_from()
});

$this->seeMessageFrom('me@example.com');

$mailer->send('example-view', [], function ($m) {
$m->from('me2@example.com', 'Name');
$m->to('john@example.com');
});

$this->seeMessageFrom('me2@example.com');
}

public function test_see_headers_for()
Expand Down

0 comments on commit a0bee24

Please sign in to comment.