@@ -31,8 +31,7 @@ protected static function getMethod($name): ReflectionMethod
3131 return $ method ;
3232 }
3333
34- /** @test */
35- public function search_specific_thread_by_subject (): void
34+ public function test_search_specific_thread_by_subject (): void
3635 {
3736 $ this ->threadFactory (['id ' => 1 , 'subject ' => 'first subject ' ]);
3837 $ this ->threadFactory (['id ' => 2 , 'subject ' => 'second subject ' ]);
@@ -44,8 +43,7 @@ public function search_specific_thread_by_subject(): void
4443 $ this ->assertSame ('first subject ' , $ threads ->first ()->subject );
4544 }
4645
47- /** @test */
48- public function search_threads_by_subject (): void
46+ public function test_search_threads_by_subject (): void
4947 {
5048 $ this ->threadFactory (['id ' => 1 , 'subject ' => 'first subject ' ]);
5149 $ this ->threadFactory (['id ' => 2 , 'subject ' => 'second subject ' ]);
@@ -61,8 +59,7 @@ public function search_threads_by_subject(): void
6159 $ this ->assertSame ('second subject ' , $ threads ->last ()->subject );
6260 }
6361
64- /** @test */
65- public function it_should_create_a_new_thread (): void
62+ public function test_it_should_create_a_new_thread (): void
6663 {
6764 $ thread = $ this ->threadFactory ();
6865 $ this ->assertSame ('Sample thread ' , $ thread ->subject );
@@ -71,8 +68,7 @@ public function it_should_create_a_new_thread(): void
7168 $ this ->assertSame ('Second sample thread ' , $ thread ->subject );
7269 }
7370
74- /** @test */
75- public function it_should_return_the_latest_message (): void
71+ public function test_it_should_return_the_latest_message (): void
7672 {
7773 $ oldMessage = $ this ->messageFactory ([
7874 'created_at ' => Carbon::yesterday (),
@@ -88,8 +84,7 @@ public function it_should_return_the_latest_message(): void
8884 $ this ->assertSame ($ newMessage ->body , $ thread ->latestMessage ->body );
8985 }
9086
91- /** @test */
92- public function it_should_return_all_threads (): void
87+ public function test_it_should_return_all_threads (): void
9388 {
9489 $ threadCount = random_int (5 , 20 );
9590
@@ -102,8 +97,7 @@ public function it_should_return_all_threads(): void
10297 $ this ->assertCount ($ threadCount , $ threads );
10398 }
10499
105- /** @test */
106- public function it_should_get_all_thread_participants (): void
100+ public function test_it_should_get_all_thread_participants (): void
107101 {
108102 $ thread = $ this ->threadFactory ();
109103 $ participantIds = $ thread ->participantsUserIds ();
@@ -126,8 +120,7 @@ public function it_should_get_all_thread_participants(): void
126120 $ this ->assertIsArray ($ participantIds );
127121 }
128122
129- /** @test */
130- public function it_should_get_all_threads_for_a_user (): void
123+ public function test_it_should_get_all_threads_for_a_user (): void
131124 {
132125 $ userId = 1 ;
133126
@@ -143,8 +136,7 @@ public function it_should_get_all_threads_for_a_user(): void
143136 $ this ->assertCount (2 , $ threads );
144137 }
145138
146- /** @test */
147- public function it_should_get_all_user_entities_for_a_thread (): void
139+ public function test_it_should_get_all_user_entities_for_a_thread (): void
148140 {
149141 $ this ->seedUsersTable ();
150142
@@ -158,8 +150,7 @@ public function it_should_get_all_user_entities_for_a_thread(): void
158150 $ this ->assertArrayHasKey (2 , $ threadUserIds );
159151 }
160152
161- /** @test */
162- public function it_should_get_all_threads_for_a_user_with_new_messages (): void
153+ public function test_it_should_get_all_threads_for_a_user_with_new_messages (): void
163154 {
164155 $ userId = 1 ;
165156
@@ -175,8 +166,7 @@ public function it_should_get_all_threads_for_a_user_with_new_messages(): void
175166 $ this ->assertCount (1 , $ threads );
176167 }
177168
178- /** @test */
179- public function it_should_get_all_threads_shared_by_specified_users (): void
169+ public function test_it_should_get_all_threads_shared_by_specified_users (): void
180170 {
181171 $ userId = 1 ;
182172 $ userId2 = 2 ;
@@ -192,8 +182,7 @@ public function it_should_get_all_threads_shared_by_specified_users(): void
192182 $ this ->assertCount (1 , $ threads );
193183 }
194184
195- /** @test **/
196- public function it_should_get_thread_between_participants (): void
185+ public function test_it_should_get_thread_between_participants (): void
197186 {
198187 $ participant_1 = 1 ;
199188 $ participant_2 = 2 ;
@@ -222,8 +211,7 @@ public function it_should_get_thread_between_participants(): void
222211 $ this ->assertCount (3 , $ threads_2 ->get ());
223212 }
224213
225- /** @test **/
226- public function it_should_get_thread_between_only_participants (): void
214+ public function test_it_should_get_thread_between_only_participants (): void
227215 {
228216 $ participant_1 = $ this ->participantFactory (['user_id ' => 1 ]);
229217 $ participant_2 = $ this ->participantFactory (['user_id ' => 2 ]);
@@ -245,8 +233,7 @@ public function it_should_get_thread_between_only_participants(): void
245233 $ this ->assertCount (1 , $ threads_2 ->get ());
246234 }
247235
248- /** @test */
249- public function it_should_add_a_participant_to_a_thread (): void
236+ public function test_it_should_add_a_participant_to_a_thread (): void
250237 {
251238 $ participant = 1 ;
252239
@@ -257,8 +244,7 @@ public function it_should_add_a_participant_to_a_thread(): void
257244 $ this ->assertSame (1 , $ thread ->participants ()->count ());
258245 }
259246
260- /** @test */
261- public function it_should_add_participants_to_a_thread_with_array (): void
247+ public function test_it_should_add_participants_to_a_thread_with_array (): void
262248 {
263249 $ participants = [1 , 2 , 3 ];
264250
@@ -269,8 +255,7 @@ public function it_should_add_participants_to_a_thread_with_array(): void
269255 $ this ->assertSame (3 , $ thread ->participants ()->count ());
270256 }
271257
272- /** @test */
273- public function it_should_add_participants_to_a_thread_with_arguments (): void
258+ public function test_it_should_add_participants_to_a_thread_with_arguments (): void
274259 {
275260 $ thread = $ this ->threadFactory ();
276261
@@ -279,8 +264,7 @@ public function it_should_add_participants_to_a_thread_with_arguments(): void
279264 $ this ->assertSame (2 , $ thread ->participants ()->count ());
280265 }
281266
282- /** @test */
283- public function it_should_mark_the_participant_as_read (): void
267+ public function test_it_should_mark_the_participant_as_read (): void
284268 {
285269 $ userId = 1 ;
286270 $ last_read = Carbon::yesterday ();
@@ -294,8 +278,7 @@ public function it_should_mark_the_participant_as_read(): void
294278 $ this ->assertNotSame ($ thread ->getParticipantFromUser ($ userId )->last_read , $ last_read );
295279 }
296280
297- /** @test */
298- public function it_should_see_if_thread_is_unread_by_user (): void
281+ public function test_it_should_see_if_thread_is_unread_by_user (): void
299282 {
300283 $ userId = 1 ;
301284
@@ -312,8 +295,7 @@ public function it_should_see_if_thread_is_unread_by_user(): void
312295 $ this ->assertTrue ($ thread2 ->isUnread ($ userId ));
313296 }
314297
315- /** @test */
316- public function it_should_get_a_participant_from_userid (): void
298+ public function test_it_should_get_a_participant_from_userid (): void
317299 {
318300 $ userId = 1 ;
319301
@@ -326,8 +308,7 @@ public function it_should_get_a_participant_from_userid(): void
326308 $ this ->assertInstanceOf (Participant::class, $ newParticipant );
327309 }
328310
329- /** @test */
330- public function it_should_throw_an_exception_when_participant_is_not_found (): void
311+ public function test_it_should_throw_an_exception_when_participant_is_not_found (): void
331312 {
332313 try {
333314 $ thread = $ this ->threadFactory ();
@@ -342,8 +323,7 @@ public function it_should_throw_an_exception_when_participant_is_not_found(): vo
342323 $ this ->fail ('ModelNotFoundException was not called. ' );
343324 }
344325
345- /** @test */
346- public function it_should_activate_all_deleted_participants (): void
326+ public function test_it_should_activate_all_deleted_participants (): void
347327 {
348328 $ deleted_at = Carbon::yesterday ();
349329 $ thread = $ this ->threadFactory ();
@@ -363,8 +343,7 @@ public function it_should_activate_all_deleted_participants(): void
363343 $ this ->assertSame (3 , $ participants ->count ());
364344 }
365345
366- /** @test */
367- public function it_should_generate_participant_select_string (): void
346+ public function test_it_should_generate_participant_select_string (): void
368347 {
369348 $ method = self ::getMethod ('createSelectString ' );
370349 $ thread = new Thread ();
@@ -390,8 +369,7 @@ public function it_should_generate_participant_select_string(): void
390369 }
391370 }
392371
393- /** @test */
394- public function it_should_get_participants_string (): void
372+ public function test_it_should_get_participants_string (): void
395373 {
396374 $ this ->seedUsersTable ();
397375
@@ -413,8 +391,7 @@ public function it_should_get_participants_string(): void
413391 $ this ->assertSame ('adam@test.com, taylor@test.com ' , $ string );
414392 }
415393
416- /** @test */
417- public function it_should_check_users_and_participants (): void
394+ public function test_it_should_check_users_and_participants (): void
418395 {
419396 $ thread = $ this ->threadFactory ();
420397
@@ -428,8 +405,7 @@ public function it_should_check_users_and_participants(): void
428405 $ this ->assertFalse ($ thread ->hasParticipant (3 ));
429406 }
430407
431- /** @test */
432- public function it_should_remove_a_single_participant (): void
408+ public function test_it_should_remove_a_single_participant (): void
433409 {
434410 $ thread = $ this ->threadFactory ();
435411
@@ -443,8 +419,7 @@ public function it_should_remove_a_single_participant(): void
443419 $ this ->assertSame (1 , $ thread ->participants ()->count ());
444420 }
445421
446- /** @test */
447- public function it_should_remove_a_group_of_participants_with_array (): void
422+ public function test_it_should_remove_a_group_of_participants_with_array (): void
448423 {
449424 $ thread = $ this ->threadFactory ();
450425
@@ -458,8 +433,7 @@ public function it_should_remove_a_group_of_participants_with_array(): void
458433 $ this ->assertSame (0 , $ thread ->participants ()->count ());
459434 }
460435
461- /** @test */
462- public function it_should_remove_a_group_of_participants_with_arguments (): void
436+ public function test_it_should_remove_a_group_of_participants_with_arguments (): void
463437 {
464438 $ thread = $ this ->threadFactory ();
465439
@@ -473,8 +447,7 @@ public function it_should_remove_a_group_of_participants_with_arguments(): void
473447 $ this ->assertSame (0 , $ thread ->participants ()->count ());
474448 }
475449
476- /** @test */
477- public function it_should_get_all_unread_messages_for_user (): void
450+ public function test_it_should_get_all_unread_messages_for_user (): void
478451 {
479452 $ thread = $ this ->threadFactory ();
480453
@@ -510,8 +483,7 @@ public function it_should_get_all_unread_messages_for_user(): void
510483 $ this ->assertSame ('Message 2 ' , $ secondParticipantUnreadMessages ->first ()->body );
511484 }
512485
513- /** @test */
514- public function it_should_get_all_unread_messages_for_user_when_dates_not_set (): void
486+ public function test_it_should_get_all_unread_messages_for_user_when_dates_not_set (): void
515487 {
516488 $ thread = $ this ->threadFactory ();
517489
@@ -547,16 +519,14 @@ public function it_should_get_all_unread_messages_for_user_when_dates_not_set():
547519 $ this ->assertSame ('Message 2 ' , $ secondParticipantUnreadMessages ->first ()->body );
548520 }
549521
550- /** @test */
551- public function it_should_return_empty_collection_when_user_not_participant (): void
522+ public function test_it_should_return_empty_collection_when_user_not_participant (): void
552523 {
553524 $ thread = $ this ->threadFactory ();
554525
555526 $ this ->assertSame (0 , $ thread ->userUnreadMessagesCount (1 ));
556527 }
557528
558- /** @test */
559- public function it_should_get_the_creator_of_a_thread (): void
529+ public function test_it_should_get_the_creator_of_a_thread (): void
560530 {
561531 $ this ->seedUsersTable ();
562532
@@ -578,11 +548,9 @@ public function it_should_get_the_creator_of_a_thread(): void
578548 }
579549
580550 /**
581- * @test
582- *
583551 * TODO: Need to get real creator of the thread without messages in future versions.
584552 */
585- public function it_should_get_the_null_creator_of_a_thread_without_messages (): void
553+ public function test_it_should_get_the_null_creator_of_a_thread_without_messages (): void
586554 {
587555 $ thread = $ this ->threadFactory ();
588556
0 commit comments