@@ -15,51 +15,64 @@ require __DIR__ . '/../bootstrap.php';
1515
1616$ mail = new Message ;
1717
18- Assert::exception (function () use ($ mail ) {
19- // From
20- $ mail ->setFrom ('John Doe <doe@example. com> ' );
21- }, Nette \Utils \AssertionException::class, "The header 'From' expects to be email, string 'doe@example. com' given. " );
18+ Assert::exception (
19+ fn () => $ mail ->setFrom ('John Doe <doe@example. com> ' ),
20+ Nette \Utils \AssertionException::class,
21+ "The header 'From' expects to be email, string 'doe@example. com' given. " ,
22+ );
2223
2324
24- Assert::exception (function () use ($ mail ) {
25- $ mail ->setFrom ('John Doe <> ' );
26- }, Nette \Utils \AssertionException::class, "The header 'From' expects to be email, string '' given. " );
25+ Assert::exception (
26+ fn () => $ mail ->setFrom ('John Doe <> ' ),
27+ Nette \Utils \AssertionException::class,
28+ "The header 'From' expects to be email, string '' given. " ,
29+ );
2730
2831
29- Assert::exception (function () use ($ mail ) {
30- $ mail ->setFrom ('John Doe <doe@examplecom> ' );
31- }, Nette \Utils \AssertionException::class, "The header 'From' expects to be email, string 'doe@examplecom' given. " );
32+ Assert::exception (
33+ fn () => $ mail ->setFrom ('John Doe <doe@examplecom> ' ),
34+ Nette \Utils \AssertionException::class,
35+ "The header 'From' expects to be email, string 'doe@examplecom' given. " ,
36+ );
3237
3338
34- Assert::exception (function () use ($ mail ) {
35- $ mail ->setFrom ('John Doe ' );
36- }, Nette \Utils \AssertionException::class, "The header 'From' expects to be email, string 'John Doe' given. " );
39+ Assert::exception (
40+ fn () => $ mail ->setFrom ('John Doe ' ),
41+ Nette \Utils \AssertionException::class,
42+ "The header 'From' expects to be email, string 'John Doe' given. " ,
43+ );
3744
3845
39- Assert::exception (function () use ($ mail ) {
40- $ mail ->setFrom ('doe;@examplecom ' );
41- }, Nette \Utils \AssertionException::class, "The header 'From' expects to be email, string 'doe;@examplecom' given. " );
46+ Assert::exception (
47+ fn () => $ mail ->setFrom ('doe;@examplecom ' ),
48+ Nette \Utils \AssertionException::class,
49+ "The header 'From' expects to be email, string 'doe;@examplecom' given. " ,
50+ );
4251
4352
44- Assert::exception (function () use ($ mail ) {
45- // addReplyTo
46- $ mail ->addReplyTo ('@ ' );
47- }, Nette \Utils \AssertionException::class, "The header 'Reply-To' expects to be email, string '@' given. " );
53+ Assert::exception (
54+ fn () => $ mail ->addReplyTo ('@ ' ),
55+ Nette \Utils \AssertionException::class,
56+ "The header 'Reply-To' expects to be email, string '@' given. " ,
57+ );
4858
4959
50- Assert::exception (function () use ($ mail ) {
51- // addTo
52- $ mail ->addTo ('@ ' );
53- }, Nette \Utils \AssertionException::class, "The header 'To' expects to be email, string '@' given. " );
60+ Assert::exception (
61+ fn () => $ mail ->addTo ('@ ' ),
62+ Nette \Utils \AssertionException::class,
63+ "The header 'To' expects to be email, string '@' given. " ,
64+ );
5465
5566
56- Assert::exception (function () use ($ mail ) {
57- // addCc
58- $ mail ->addCc ('@ ' );
59- }, Nette \Utils \AssertionException::class, "The header 'Cc' expects to be email, string '@' given. " );
67+ Assert::exception (
68+ fn () => $ mail ->addCc ('@ ' ),
69+ Nette \Utils \AssertionException::class,
70+ "The header 'Cc' expects to be email, string '@' given. " ,
71+ );
6072
6173
62- Assert::exception (function () use ($ mail ) {
63- // addBcc
64- $ mail ->addBcc ('@ ' );
65- }, Nette \Utils \AssertionException::class, "The header 'Bcc' expects to be email, string '@' given. " );
74+ Assert::exception (
75+ fn () => $ mail ->addBcc ('@ ' ),
76+ Nette \Utils \AssertionException::class,
77+ "The header 'Bcc' expects to be email, string '@' given. " ,
78+ );
0 commit comments