44
55use Carbon \Carbon ;
66use Illuminate \Support \Facades \DB ;
7+ use PHPUnit \Framework \Attributes \Test ;
78
89class DatabaseInteractionTest extends TestCase
910{
10- /** @test */
11+ #[Test]
1112 public function label_should_be_saved_correctly ()
1213 {
1314 $ email = $ this ->sendEmail (['label ' => 'welcome-email ' ]);
@@ -16,15 +17,15 @@ public function label_should_be_saved_correctly()
1617 $ this ->assertEquals ('welcome-email ' , $ email ->getLabel ());
1718 }
1819
19- /** @test */
20+ #[Test]
2021 public function recipient_should_be_saved_correctly ()
2122 {
2223 $ email = $ this ->sendEmail (['recipient ' => 'john@doe.com ' ]);
2324
2425 $ this ->assertEquals ('john@doe.com ' , $ email ->getRecipient ());
2526 }
2627
27- /** @test */
28+ #[Test]
2829 public function cc_and_bcc_should_be_saved_correctly ()
2930 {
3031 $ email = $ this ->sendEmail ([
@@ -44,7 +45,7 @@ public function cc_and_bcc_should_be_saved_correctly()
4445 $ this ->assertEquals (['jane@doe.com ' ], $ email ->getBcc ());
4546 }
4647
47- /** @test */
48+ #[Test]
4849 public function reply_to_should_be_saved_correctly ()
4950 {
5051 $ email = $ this ->sendEmail ([
@@ -58,7 +59,7 @@ public function reply_to_should_be_saved_correctly()
5859 $ this ->assertEquals (['john@doe.com ' ], $ email ->getReplyTo ());
5960 }
6061
61- /** @test */
62+ #[Test]
6263 public function subject_should_be_saved_correclty ()
6364 {
6465 $ email = $ this ->sendEmail (['subject ' => 'test subject ' ]);
@@ -67,7 +68,7 @@ public function subject_should_be_saved_correclty()
6768 $ this ->assertEquals ('test subject ' , $ email ->getSubject ());
6869 }
6970
70- /** @test */
71+ #[Test]
7172 public function view_should_be_saved_correctly ()
7273 {
7374 $ email = $ this ->sendEmail (['view ' => 'tests::dummy ' ]);
@@ -76,7 +77,7 @@ public function view_should_be_saved_correctly()
7677 $ this ->assertEquals ('tests::dummy ' , $ email ->getView ());
7778 }
7879
79- /** @test */
80+ #[Test]
8081 public function encrypted_should_be_saved_correctly ()
8182 {
8283 $ email = $ this ->sendEmail ();
@@ -92,7 +93,7 @@ public function encrypted_should_be_saved_correctly()
9293 $ this ->assertTrue ($ email ->isEncrypted ());
9394 }
9495
95- /** @test */
96+ #[Test]
9697 public function scheduled_date_should_be_saved_correctly ()
9798 {
9899 $ email = $ this ->sendEmail ();
@@ -105,7 +106,7 @@ public function scheduled_date_should_be_saved_correctly()
105106 $ this ->assertEquals ('2019-01-15 01:02:03 ' , $ email ->getScheduledDate ());
106107 }
107108
108- /** @test */
109+ #[Test]
109110 public function the_body_should_be_saved_correctly ()
110111 {
111112 $ email = $ this ->sendEmail (['variables ' => ['name ' => 'Jane Doe ' ]]);
@@ -116,7 +117,7 @@ public function the_body_should_be_saved_correctly()
116117 $ this ->assertSame ($ expectedBody , $ email ->getBody ());
117118 }
118119
119- /** @test */
120+ #[Test]
120121 public function from_should_be_saved_correctly ()
121122 {
122123 $ email = $ this ->composeEmail ()->send ();
@@ -132,7 +133,7 @@ public function from_should_be_saved_correctly()
132133 $ this ->assertEquals ('Marick ' , $ email ->getFromName ());
133134 }
134135
135- /** @test */
136+ #[Test]
136137 public function variables_should_be_saved_correctly ()
137138 {
138139 $ email = $ this ->sendEmail (['variables ' => ['name ' => 'John Doe ' ]]);
@@ -141,7 +142,7 @@ public function variables_should_be_saved_correctly()
141142 $ this ->assertEquals (['name ' => 'John Doe ' ], $ email ->getVariables ());
142143 }
143144
144- /** @test */
145+ #[Test]
145146 public function the_sent_date_should_be_null ()
146147 {
147148 $ email = $ this ->sendEmail ();
@@ -150,7 +151,7 @@ public function the_sent_date_should_be_null()
150151 $ this ->assertNull ($ email ->getSendDate ());
151152 }
152153
153- /** @test */
154+ #[Test]
154155 public function failed_should_be_zero ()
155156 {
156157 $ email = $ this ->sendEmail ();
@@ -159,7 +160,7 @@ public function failed_should_be_zero()
159160 $ this ->assertFalse ($ email ->hasFailed ());
160161 }
161162
162- /** @test */
163+ #[Test]
163164 public function attempts_should_be_zero ()
164165 {
165166 $ email = $ this ->sendEmail ();
@@ -168,7 +169,7 @@ public function attempts_should_be_zero()
168169 $ this ->assertEquals (0 , $ email ->getAttempts ());
169170 }
170171
171- /** @test */
172+ #[Test]
172173 public function the_scheduled_date_should_be_saved_correctly ()
173174 {
174175 Carbon::setTestNow (Carbon::now ());
@@ -181,7 +182,7 @@ public function the_scheduled_date_should_be_saved_correctly()
181182 $ this ->assertEquals ($ scheduledFor , $ email ->getScheduledDate ());
182183 }
183184
184- /** @test */
185+ #[Test]
185186 public function recipient_should_be_swapped_for_test_address_when_in_testing_mode ()
186187 {
187188 $ 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
194195 $ this ->assertEquals ('test@address.com ' , $ email ->getRecipient ());
195196 }
196197
197- /** @test */
198+ #[Test]
198199 public function attachments_should_be_saved_correctly ()
199200 {
200201 $ email = $ this ->composeEmail ()
@@ -219,7 +220,7 @@ public function attachments_should_be_saved_correctly()
219220 $ this ->assertEquals (__DIR__ . '/files/pdf-sample-2.pdf ' , $ email ->getAttachments ()[1 ]['attachment ' ]['file ' ]);
220221 }
221222
222- /** @test */
223+ #[Test]
223224 public function in_memory_attachments_should_be_saved_correctly ()
224225 {
225226 $ rawData = file_get_contents (__DIR__ . '/files/pdf-sample.pdf ' );
0 commit comments