Skip to content

Commit 3e2ed2c

Browse files
committed
test: add format email list parsing test
1 parent 91aad65 commit 3e2ed2c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/LaravelGmailTest.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,20 @@ public function test_markdown_method()
2323

2424
// trigger
2525
(new Mail())->markdown(
26-
'sample-markdown',
26+
'sample-markdown',
2727
[ 'url' => 'https://www.google.com' ]
2828
);
2929
}
30+
31+
/** @test */
32+
public function test_format_email_list_parses_names_and_addresses()
33+
{
34+
$emails = 'Alice <alice@example.com>, Bob <bob@example.com>';
35+
36+
$formatted = (new Mail())->formatEmailList($emails);
37+
38+
$this->assertCount(2, $formatted);
39+
$this->assertEquals(['name' => 'Alice', 'email' => 'alice@example.com'], $formatted[0]);
40+
$this->assertEquals(['name' => 'Bob', 'email' => 'bob@example.com'], $formatted[1]);
41+
}
3042
}

0 commit comments

Comments
 (0)