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

Commit fda78fe

Browse files
authored
Merge pull request #70 from exls/master
Fix: trait method seeMessageFrom should work when from set with name
2 parents 3269c0b + a0bee24 commit fda78fe

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Testing/InteractsWithMail.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ public function seeMessageFrom($email)
9494
{
9595
$this->seeMessage();
9696

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

99101
$this->assertEquals(
100102
$email,

tests/InteractsWithMailTest.php

+7
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ public function test_see_message_from()
148148
});
149149

150150
$this->seeMessageFrom('[email protected]');
151+
152+
$mailer->send('example-view', [], function ($m) {
153+
$m->from('[email protected]', 'Name');
154+
$m->to('[email protected]');
155+
});
156+
157+
$this->seeMessageFrom('[email protected]');
151158
}
152159

153160
public function test_see_headers_for()

0 commit comments

Comments
 (0)