@@ -15,51 +15,64 @@ require __DIR__ . '/../bootstrap.php';
15
15
16
16
$ mail = new Message ;
17
17
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
+ );
22
23
23
24
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
+ );
27
30
28
31
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
+ );
32
37
33
38
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
+ );
37
44
38
45
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
+ );
42
51
43
52
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
+ );
48
58
49
59
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
+ );
54
65
55
66
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
+ );
60
72
61
73
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