File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 10
10
final class NotifyUsersMentionedInThread
11
11
{
12
12
public function handle (ThreadWasCreated $ event ): void
13
- {
13
+ {dd ( ' test ' );
14
14
$ event ->thread ->mentionedUsers ()->each (function ($ user ) use ($ event ) {
15
15
if (! $ user ->isNotificationAllowed (MentionNotification::class)) {
16
16
return ;
Original file line number Diff line number Diff line change 201
201
'replyable_type ' => Thread::TABLE ,
202
202
]);
203
203
204
- $ notification = DatabaseNotification::first ();
205
- $ this ->assertSame ($ user ->id , (int ) $ notification ->notifiable_id );
206
- $ this ->assertSame ('users ' , $ notification ->notifiable_type );
207
- $ this ->assertSame ('mention ' , $ notification ->data ['type ' ]);
208
- $ this ->assertSame ('The first thread ' , $ notification ->data ['replyable_subject ' ]);
204
+ $ tested = false ;
205
+
206
+ foreach (DatabaseNotification::all () as $ notification ) {
207
+ if ($ notification ->type === MentionNotification::class) {
208
+ $ this ->assertSame ($ user ->id , (int ) $ notification ->notifiable_id );
209
+ $ this ->assertSame ('users ' , $ notification ->notifiable_type );
210
+ $ this ->assertSame ('mention ' , $ notification ->data ['type ' ]);
211
+ $ this ->assertSame ('The first thread ' , $ notification ->data ['replyable_subject ' ]);
212
+
213
+ $ tested = true ;
214
+ }
215
+ }
216
+
217
+ $ this ->assertTrue ($ tested );
209
218
})->only ();
210
219
211
220
test ('users are not notified when mentioned in an edited reply ' , function () {
You can’t perform that action at this time.
0 commit comments