@@ -39,9 +39,9 @@ public function search_specific_thread_by_subject(): void
39
39
40
40
$ threads = Thread::getBySubject ('first subject ' );
41
41
42
- $ this ->assertEquals (1 , $ threads ->count ());
43
- $ this ->assertEquals (1 , $ threads ->first ()->id );
44
- $ this ->assertEquals ('first subject ' , $ threads ->first ()->subject );
42
+ $ this ->assertSame (1 , $ threads ->count ());
43
+ $ this ->assertSame (1 , $ threads ->first ()->id );
44
+ $ this ->assertSame ('first subject ' , $ threads ->first ()->subject );
45
45
}
46
46
47
47
/** @test */
@@ -52,23 +52,23 @@ public function search_threads_by_subject(): void
52
52
53
53
$ threads = Thread::getBySubject ('%subject ' );
54
54
55
- $ this ->assertEquals (2 , $ threads ->count ());
55
+ $ this ->assertSame (2 , $ threads ->count ());
56
56
57
- $ this ->assertEquals (1 , $ threads ->first ()->id );
58
- $ this ->assertEquals ('first subject ' , $ threads ->first ()->subject );
57
+ $ this ->assertSame (1 , $ threads ->first ()->id );
58
+ $ this ->assertSame ('first subject ' , $ threads ->first ()->subject );
59
59
60
- $ this ->assertEquals (2 , $ threads ->last ()->id );
61
- $ this ->assertEquals ('second subject ' , $ threads ->last ()->subject );
60
+ $ this ->assertSame (2 , $ threads ->last ()->id );
61
+ $ this ->assertSame ('second subject ' , $ threads ->last ()->subject );
62
62
}
63
63
64
64
/** @test */
65
65
public function it_should_create_a_new_thread (): void
66
66
{
67
67
$ thread = $ this ->threadFactory ();
68
- $ this ->assertEquals ('Sample thread ' , $ thread ->subject );
68
+ $ this ->assertSame ('Sample thread ' , $ thread ->subject );
69
69
70
70
$ thread = $ this ->threadFactory (['subject ' => 'Second sample thread ' ]);
71
- $ this ->assertEquals ('Second sample thread ' , $ thread ->subject );
71
+ $ this ->assertSame ('Second sample thread ' , $ thread ->subject );
72
72
}
73
73
74
74
/** @test */
@@ -85,7 +85,7 @@ public function it_should_return_the_latest_message(): void
85
85
86
86
$ thread = $ this ->threadFactory ();
87
87
$ thread ->messages ()->saveMany ([$ oldMessage , $ newMessage ]);
88
- $ this ->assertEquals ($ newMessage ->body , $ thread ->latestMessage ->body );
88
+ $ this ->assertSame ($ newMessage ->body , $ thread ->latestMessage ->body );
89
89
}
90
90
91
91
/** @test */
@@ -117,11 +117,11 @@ public function it_should_get_all_thread_participants(): void
117
117
118
118
$ participantIds = $ thread ->participantsUserIds ();
119
119
$ this ->assertCount (3 , $ participantIds );
120
- $ this ->assertEquals (2 , $ participantIds [1 ]);
120
+ $ this ->assertSame (2 , ( int ) $ participantIds [1 ]);
121
121
122
122
$ participantIds = $ thread ->participantsUserIds (999 );
123
123
$ this ->assertCount (4 , $ participantIds );
124
- $ this ->assertEquals (999 , end ($ participantIds ));
124
+ $ this ->assertSame (999 , end ($ participantIds ));
125
125
126
126
$ this ->assertIsArray ($ participantIds );
127
127
}
@@ -254,7 +254,7 @@ public function it_should_add_a_participant_to_a_thread(): void
254
254
255
255
$ thread ->addParticipant ($ participant );
256
256
257
- $ this ->assertEquals (1 , $ thread ->participants ()->count ());
257
+ $ this ->assertSame (1 , $ thread ->participants ()->count ());
258
258
}
259
259
260
260
/** @test */
@@ -266,7 +266,7 @@ public function it_should_add_participants_to_a_thread_with_array(): void
266
266
267
267
$ thread ->addParticipant ($ participants );
268
268
269
- $ this ->assertEquals (3 , $ thread ->participants ()->count ());
269
+ $ this ->assertSame (3 , $ thread ->participants ()->count ());
270
270
}
271
271
272
272
/** @test */
@@ -276,7 +276,7 @@ public function it_should_add_participants_to_a_thread_with_arguments(): void
276
276
277
277
$ thread ->addParticipant (1 , 2 );
278
278
279
- $ this ->assertEquals (2 , $ thread ->participants ()->count ());
279
+ $ this ->assertSame (2 , $ thread ->participants ()->count ());
280
280
}
281
281
282
282
/** @test */
@@ -291,7 +291,7 @@ public function it_should_mark_the_participant_as_read(): void
291
291
292
292
$ thread ->markAsRead ($ userId );
293
293
294
- $ this ->assertNotEquals ($ thread ->getParticipantFromUser ($ userId )->last_read , $ last_read );
294
+ $ this ->assertNotSame ($ thread ->getParticipantFromUser ($ userId )->last_read , $ last_read );
295
295
}
296
296
297
297
/** @test */
@@ -355,12 +355,12 @@ public function it_should_activate_all_deleted_participants(): void
355
355
$ thread ->participants ()->saveMany ([$ user_1 , $ user_2 , $ user_3 ]);
356
356
357
357
$ participants = $ thread ->participants ();
358
- $ this ->assertEquals (0 , $ participants ->count ());
358
+ $ this ->assertSame (0 , $ participants ->count ());
359
359
360
360
$ thread ->activateAllParticipants ();
361
361
362
362
$ participants = $ thread ->participants ();
363
- $ this ->assertEquals (3 , $ participants ->count ());
363
+ $ this ->assertSame (3 , $ participants ->count ());
364
364
}
365
365
366
366
/** @test */
@@ -375,18 +375,18 @@ public function it_should_generate_participant_select_string(): void
375
375
$ expectedString = '( ' . Eloquent::getConnectionResolver ()->getTablePrefix () . $ tableName . '.name) as name ' ;
376
376
377
377
if (config ('database.connections.testbench.driver ' ) === 'mysql ' ) {
378
- $ this ->assertEquals ('concat ' . $ expectedString , $ select );
378
+ $ this ->assertSame ('concat ' . $ expectedString , $ select );
379
379
} else {
380
- $ this ->assertEquals ($ expectedString , $ select );
380
+ $ this ->assertSame ($ expectedString , $ select );
381
381
}
382
382
383
383
$ columns = ['name ' , 'email ' ];
384
384
$ select = $ method ->invokeArgs ($ thread , [$ columns ]);
385
385
386
386
if (config ('database.connections.testbench.driver ' ) === 'mysql ' ) {
387
- $ this ->assertEquals ('concat( ' . Eloquent::getConnectionResolver ()->getTablePrefix () . $ tableName . ".name, ' ', " . Eloquent::getConnectionResolver ()->getTablePrefix () . $ tableName . '.email) as name ' , $ select );
387
+ $ this ->assertSame ('concat( ' . Eloquent::getConnectionResolver ()->getTablePrefix () . $ tableName . ".name, ' ', " . Eloquent::getConnectionResolver ()->getTablePrefix () . $ tableName . '.email) as name ' , $ select );
388
388
} else {
389
- $ this ->assertEquals ('( ' . Eloquent::getConnectionResolver ()->getTablePrefix () . $ tableName . ".name || ' ' || " . Eloquent::getConnectionResolver ()->getTablePrefix () . $ tableName . '.email) as name ' , $ select );
389
+ $ this ->assertSame ('( ' . Eloquent::getConnectionResolver ()->getTablePrefix () . $ tableName . ".name || ' ' || " . Eloquent::getConnectionResolver ()->getTablePrefix () . $ tableName . '.email) as name ' , $ select );
390
390
}
391
391
}
392
392
@@ -404,13 +404,13 @@ public function it_should_get_participants_string(): void
404
404
$ thread ->participants ()->saveMany ([$ participant_1 , $ participant_2 , $ participant_3 ]);
405
405
406
406
$ string = $ thread ->participantsString ();
407
- $ this ->assertEquals ('Chris Gmyr, Adam Wathan, Taylor Otwell ' , $ string );
407
+ $ this ->assertSame ('Chris Gmyr, Adam Wathan, Taylor Otwell ' , $ string );
408
408
409
409
$ string = $ thread ->participantsString (1 );
410
- $ this ->assertEquals ('Adam Wathan, Taylor Otwell ' , $ string );
410
+ $ this ->assertSame ('Adam Wathan, Taylor Otwell ' , $ string );
411
411
412
412
$ string = $ thread ->participantsString (1 , ['email ' ]);
413
- $ this ->
assertEquals (
'[email protected] , [email protected] ' ,
$ string);
413
+
414
414
}
415
415
416
416
/** @test */
@@ -440,7 +440,7 @@ public function it_should_remove_a_single_participant(): void
440
440
441
441
$ thread ->removeParticipant (2 );
442
442
443
- $ this ->assertEquals (1 , $ thread ->participants ()->count ());
443
+ $ this ->assertSame (1 , $ thread ->participants ()->count ());
444
444
}
445
445
446
446
/** @test */
@@ -455,7 +455,7 @@ public function it_should_remove_a_group_of_participants_with_array(): void
455
455
456
456
$ thread ->removeParticipant ([1 , 2 ]);
457
457
458
- $ this ->assertEquals (0 , $ thread ->participants ()->count ());
458
+ $ this ->assertSame (0 , $ thread ->participants ()->count ());
459
459
}
460
460
461
461
/** @test */
@@ -470,7 +470,7 @@ public function it_should_remove_a_group_of_participants_with_arguments(): void
470
470
471
471
$ thread ->removeParticipant (1 , 2 );
472
472
473
- $ this ->assertEquals (0 , $ thread ->participants ()->count ());
473
+ $ this ->assertSame (0 , $ thread ->participants ()->count ());
474
474
}
475
475
476
476
/** @test */
@@ -507,7 +507,7 @@ public function it_should_get_all_unread_messages_for_user(): void
507
507
508
508
$ secondParticipantUnreadMessages = $ thread ->userUnreadMessages ($ participant_2 ->user_id );
509
509
$ this ->assertCount (1 , $ secondParticipantUnreadMessages );
510
- $ this ->assertEquals ('Message 2 ' , $ secondParticipantUnreadMessages ->first ()->body );
510
+ $ this ->assertSame ('Message 2 ' , $ secondParticipantUnreadMessages ->first ()->body );
511
511
}
512
512
513
513
/** @test */
@@ -544,15 +544,15 @@ public function it_should_get_all_unread_messages_for_user_when_dates_not_set():
544
544
545
545
$ secondParticipantUnreadMessages = $ thread ->userUnreadMessages ($ participant_2 ->user_id );
546
546
$ this ->assertCount (1 , $ secondParticipantUnreadMessages );
547
- $ this ->assertEquals ('Message 2 ' , $ secondParticipantUnreadMessages ->first ()->body );
547
+ $ this ->assertSame ('Message 2 ' , $ secondParticipantUnreadMessages ->first ()->body );
548
548
}
549
549
550
550
/** @test */
551
551
public function it_should_return_empty_collection_when_user_not_participant (): void
552
552
{
553
553
$ thread = $ this ->threadFactory ();
554
554
555
- $ this ->assertEquals (0 , $ thread ->userUnreadMessagesCount (1 ));
555
+ $ this ->assertSame (0 , $ thread ->userUnreadMessagesCount (1 ));
556
556
}
557
557
558
558
/** @test */
@@ -574,7 +574,7 @@ public function it_should_get_the_creator_of_a_thread(): void
574
574
575
575
$ thread ->messages ()->saveMany ([$ message_1 , $ message_2 , $ message_3 ]);
576
576
577
- $ this ->assertEquals ('Chris Gmyr ' , $ thread ->creator ()->name );
577
+ $ this ->assertSame ('Chris Gmyr ' , $ thread ->creator ()->name );
578
578
}
579
579
580
580
/**
0 commit comments