File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 55use Illuminate \Contracts \Events \Dispatcher ;
66use Illuminate \Notifications \Events \NotificationFailed ;
77use Illuminate \Notifications \Notification ;
8+ use Illuminate \Support \Facades \Notification as NotificationFacade ;
89use Mockery ;
910use NotificationChannels \AwsSns \Sns ;
1011use NotificationChannels \AwsSns \SnsChannel ;
@@ -115,6 +116,22 @@ public function it_will_dispatch_an_event_in_case_of_an_invalid_message()
115116
116117 $ this ->channel ->send ($ notifiable , $ notification );
117118 }
119+
120+ /** @test */
121+ public function it_will_send_a_sms_to_an_anonymous_notifiable ()
122+ {
123+ $ notification = Mockery::mock (Notification::class);
124+ $ notification ->shouldReceive ('toSns ' )->andReturn ('Message text ' );
125+
126+ $ phoneNumber = '+22222222222 ' ;
127+ $ anonymousNotifiable = NotificationFacade::route ('sns ' , $ phoneNumber );
128+
129+ $ this ->sns ->shouldReceive ('send ' )
130+ ->atLeast ()->once ()
131+ ->with (Mockery::type (SnsMessage::class), $ phoneNumber );
132+
133+ $ this ->channel ->send ($ anonymousNotifiable , $ notification );
134+ }
118135}
119136
120137class Notifiable
You can’t perform that action at this time.
0 commit comments