4
4
5
5
use Carbon \Carbon ;
6
6
use Illuminate \Support \Facades \DB ;
7
+ use PHPUnit \Framework \Attributes \Test ;
7
8
8
9
class DatabaseInteractionTest extends TestCase
9
10
{
10
- /** @test */
11
+ #[Test]
11
12
public function label_should_be_saved_correctly ()
12
13
{
13
14
$ email = $ this ->sendEmail (['label ' => 'welcome-email ' ]);
@@ -16,15 +17,15 @@ public function label_should_be_saved_correctly()
16
17
$ this ->assertEquals ('welcome-email ' , $ email ->getLabel ());
17
18
}
18
19
19
- /** @test */
20
+ #[Test]
20
21
public function recipient_should_be_saved_correctly ()
21
22
{
22
23
$ email =
$ this ->
sendEmail ([
'recipient ' =>
'[email protected] ' ]);
23
24
24
25
$ this ->
assertEquals (
'[email protected] ' ,
$ email->
getRecipient ());
25
26
}
26
27
27
- /** @test */
28
+ #[Test]
28
29
public function cc_and_bcc_should_be_saved_correctly ()
29
30
{
30
31
$ email = $ this ->sendEmail ([
@@ -44,7 +45,7 @@ public function cc_and_bcc_should_be_saved_correctly()
44
45
$ this ->
assertEquals ([
'[email protected] ' ],
$ email->
getBcc ());
45
46
}
46
47
47
- /** @test */
48
+ #[Test]
48
49
public function reply_to_should_be_saved_correctly ()
49
50
{
50
51
$ email = $ this ->sendEmail ([
@@ -58,7 +59,7 @@ public function reply_to_should_be_saved_correctly()
58
59
$ this ->
assertEquals ([
'[email protected] ' ],
$ email->
getReplyTo ());
59
60
}
60
61
61
- /** @test */
62
+ #[Test]
62
63
public function subject_should_be_saved_correclty ()
63
64
{
64
65
$ email = $ this ->sendEmail (['subject ' => 'test subject ' ]);
@@ -67,7 +68,7 @@ public function subject_should_be_saved_correclty()
67
68
$ this ->assertEquals ('test subject ' , $ email ->getSubject ());
68
69
}
69
70
70
- /** @test */
71
+ #[Test]
71
72
public function view_should_be_saved_correctly ()
72
73
{
73
74
$ email = $ this ->sendEmail (['view ' => 'tests::dummy ' ]);
@@ -76,7 +77,7 @@ public function view_should_be_saved_correctly()
76
77
$ this ->assertEquals ('tests::dummy ' , $ email ->getView ());
77
78
}
78
79
79
- /** @test */
80
+ #[Test]
80
81
public function encrypted_should_be_saved_correctly ()
81
82
{
82
83
$ email = $ this ->sendEmail ();
@@ -92,7 +93,7 @@ public function encrypted_should_be_saved_correctly()
92
93
$ this ->assertTrue ($ email ->isEncrypted ());
93
94
}
94
95
95
- /** @test */
96
+ #[Test]
96
97
public function scheduled_date_should_be_saved_correctly ()
97
98
{
98
99
$ email = $ this ->sendEmail ();
@@ -105,7 +106,7 @@ public function scheduled_date_should_be_saved_correctly()
105
106
$ this ->assertEquals ('2019-01-15 01:02:03 ' , $ email ->getScheduledDate ());
106
107
}
107
108
108
- /** @test */
109
+ #[Test]
109
110
public function the_body_should_be_saved_correctly ()
110
111
{
111
112
$ email = $ this ->sendEmail (['variables ' => ['name ' => 'Jane Doe ' ]]);
@@ -116,7 +117,7 @@ public function the_body_should_be_saved_correctly()
116
117
$ this ->assertSame ($ expectedBody , $ email ->getBody ());
117
118
}
118
119
119
- /** @test */
120
+ #[Test]
120
121
public function from_should_be_saved_correctly ()
121
122
{
122
123
$ email = $ this ->composeEmail ()->send ();
@@ -132,7 +133,7 @@ public function from_should_be_saved_correctly()
132
133
$ this ->assertEquals ('Marick ' , $ email ->getFromName ());
133
134
}
134
135
135
- /** @test */
136
+ #[Test]
136
137
public function variables_should_be_saved_correctly ()
137
138
{
138
139
$ email = $ this ->sendEmail (['variables ' => ['name ' => 'John Doe ' ]]);
@@ -141,7 +142,7 @@ public function variables_should_be_saved_correctly()
141
142
$ this ->assertEquals (['name ' => 'John Doe ' ], $ email ->getVariables ());
142
143
}
143
144
144
- /** @test */
145
+ #[Test]
145
146
public function the_sent_date_should_be_null ()
146
147
{
147
148
$ email = $ this ->sendEmail ();
@@ -150,7 +151,7 @@ public function the_sent_date_should_be_null()
150
151
$ this ->assertNull ($ email ->getSendDate ());
151
152
}
152
153
153
- /** @test */
154
+ #[Test]
154
155
public function failed_should_be_zero ()
155
156
{
156
157
$ email = $ this ->sendEmail ();
@@ -159,7 +160,7 @@ public function failed_should_be_zero()
159
160
$ this ->assertFalse ($ email ->hasFailed ());
160
161
}
161
162
162
- /** @test */
163
+ #[Test]
163
164
public function attempts_should_be_zero ()
164
165
{
165
166
$ email = $ this ->sendEmail ();
@@ -168,7 +169,7 @@ public function attempts_should_be_zero()
168
169
$ this ->assertEquals (0 , $ email ->getAttempts ());
169
170
}
170
171
171
- /** @test */
172
+ #[Test]
172
173
public function the_scheduled_date_should_be_saved_correctly ()
173
174
{
174
175
Carbon::setTestNow (Carbon::now ());
@@ -181,7 +182,7 @@ public function the_scheduled_date_should_be_saved_correctly()
181
182
$ this ->assertEquals ($ scheduledFor , $ email ->getScheduledDate ());
182
183
}
183
184
184
- /** @test */
185
+ #[Test]
185
186
public function recipient_should_be_swapped_for_test_address_when_in_testing_mode ()
186
187
{
187
188
$ this ->app ['config ' ]->set ('laravel-database-emails.testing.enabled ' , function () {
@@ -194,7 +195,7 @@ public function recipient_should_be_swapped_for_test_address_when_in_testing_mod
194
195
$ this ->
assertEquals (
'[email protected] ' ,
$ email->
getRecipient ());
195
196
}
196
197
197
- /** @test */
198
+ #[Test]
198
199
public function attachments_should_be_saved_correctly ()
199
200
{
200
201
$ email = $ this ->composeEmail ()
@@ -219,7 +220,7 @@ public function attachments_should_be_saved_correctly()
219
220
$ this ->assertEquals (__DIR__ . '/files/pdf-sample-2.pdf ' , $ email ->getAttachments ()[1 ]['attachment ' ]['file ' ]);
220
221
}
221
222
222
- /** @test */
223
+ #[Test]
223
224
public function in_memory_attachments_should_be_saved_correctly ()
224
225
{
225
226
$ rawData = file_get_contents (__DIR__ . '/files/pdf-sample.pdf ' );
0 commit comments