1111use SMSFactor \SMSFactor ;
1212use Xefi \SmsFactor \Channels \SmsFactorSmsChannel ;
1313use Xefi \SmsFactor \Messages \SmsFactorMessage ;
14- use Xefi \SmsFactor \SmsFactorChannelServiceProvider ;
1514
1615class SmsFactorSmsChannelTest extends TestCase
1716{
@@ -24,20 +23,20 @@ protected function setUp(): void
2423
2524 public function testSmsIsSentViaSmsFactor ()
2625 {
27- $ notification = new NotificationSmsFactorSmsChannelTestNotification ;
28- $ notifiable = new NotificationSmsFactorSmsChannelTestNotifiable ;
26+ $ notification = new NotificationSmsFactorSmsChannelTestNotification () ;
27+ $ notifiable = new NotificationSmsFactorSmsChannelTestNotifiable () ;
2928
3029 $ channel = new SmsFactorSmsChannel ();
3130
3231 $ this ->mock ('alias: ' .Message::class, function (MockInterface $ mock ) {
3332 $ mock ->shouldReceive ('send ' )
3433 ->with (
3534 [
36- 'to ' => '5555555555 ' ,
37- 'text ' => 'this is my message ' ,
38- 'delay ' => null ,
35+ 'to ' => '5555555555 ' ,
36+ 'text ' => 'this is my message ' ,
37+ 'delay ' => null ,
3938 'pushtype ' => null ,
40- 'sender ' => null ,
39+ 'sender ' => null ,
4140 'gsmsmsid ' => null ,
4241 ]
4342 )
@@ -49,20 +48,20 @@ public function testSmsIsSentViaSmsFactor()
4948
5049 public function testSmsIsSentViaSmsFactorWithCustomSender ()
5150 {
52- $ notification = new NotificationSmsFactorSmsChannelTestCustomSenderNotification ;
53- $ notifiable = new NotificationSmsFactorSmsChannelTestNotifiable ;
51+ $ notification = new NotificationSmsFactorSmsChannelTestCustomSenderNotification () ;
52+ $ notifiable = new NotificationSmsFactorSmsChannelTestNotifiable () ;
5453
5554 $ channel = new SmsFactorSmsChannel ();
5655
5756 $ this ->mock ('alias: ' .Message::class, function (MockInterface $ mock ) {
5857 $ mock ->shouldReceive ('send ' )
5958 ->with (
6059 [
61- 'to ' => '5555555555 ' ,
62- 'text ' => 'this is my message ' ,
63- 'delay ' => null ,
60+ 'to ' => '5555555555 ' ,
61+ 'text ' => 'this is my message ' ,
62+ 'delay ' => null ,
6463 'pushtype ' => null ,
65- 'sender ' => '12345 ' ,
64+ 'sender ' => '12345 ' ,
6665 'gsmsmsid ' => null ,
6766 ]
6867 )
@@ -74,20 +73,20 @@ public function testSmsIsSentViaSmsFactorWithCustomSender()
7473
7574 public function testSmsIsSentViaSmsFactorWithCustomDelay ()
7675 {
77- $ notification = new NotificationSmsFactorSmsChannelTestCustomDelayNotification ;
78- $ notifiable = new NotificationSmsFactorSmsChannelTestNotifiable ;
76+ $ notification = new NotificationSmsFactorSmsChannelTestCustomDelayNotification () ;
77+ $ notifiable = new NotificationSmsFactorSmsChannelTestNotifiable () ;
7978
8079 $ channel = new SmsFactorSmsChannel ();
8180
8281 $ this ->mock ('alias: ' .Message::class, function (MockInterface $ mock ) {
8382 $ mock ->shouldReceive ('send ' )
8483 ->with (
8584 [
86- 'to ' => '5555555555 ' ,
87- 'text ' => 'this is my message ' ,
88- 'delay ' => Carbon::create (2024 , 01 , 01 )->format ('Y-m-d H:i:s ' ),
85+ 'to ' => '5555555555 ' ,
86+ 'text ' => 'this is my message ' ,
87+ 'delay ' => Carbon::create (2024 , 01 , 01 )->format ('Y-m-d H:i:s ' ),
8988 'pushtype ' => null ,
90- 'sender ' => null ,
89+ 'sender ' => null ,
9190 'gsmsmsid ' => null ,
9291 ]
9392 )
@@ -99,20 +98,20 @@ public function testSmsIsSentViaSmsFactorWithCustomDelay()
9998
10099 public function testSmsIsSentViaSmsFactorWithCustomPushType ()
101100 {
102- $ notification = new NotificationSmsFactorSmsChannelTestCustomPushTypeNotification ;
103- $ notifiable = new NotificationSmsFactorSmsChannelTestNotifiable ;
101+ $ notification = new NotificationSmsFactorSmsChannelTestCustomPushTypeNotification () ;
102+ $ notifiable = new NotificationSmsFactorSmsChannelTestNotifiable () ;
104103
105104 $ channel = new SmsFactorSmsChannel ();
106105
107106 $ this ->mock ('alias: ' .Message::class, function (MockInterface $ mock ) {
108107 $ mock ->shouldReceive ('send ' )
109108 ->with (
110109 [
111- 'to ' => '5555555555 ' ,
112- 'text ' => 'this is my message ' ,
113- 'delay ' => null ,
110+ 'to ' => '5555555555 ' ,
111+ 'text ' => 'this is my message ' ,
112+ 'delay ' => null ,
114113 'pushtype ' => 'alert ' ,
115- 'sender ' => null ,
114+ 'sender ' => null ,
116115 'gsmsmsid ' => null ,
117116 ]
118117 )
@@ -124,20 +123,20 @@ public function testSmsIsSentViaSmsFactorWithCustomPushType()
124123
125124 public function testSmsIsSentViaSmsFactorWithCustomGsmsmsid ()
126125 {
127- $ notification = new NotificationSmsFactorSmsChannelTestCustomGsmsmsidNotification ;
128- $ notifiable = new NotificationSmsFactorSmsChannelTestNotifiable ;
126+ $ notification = new NotificationSmsFactorSmsChannelTestCustomGsmsmsidNotification () ;
127+ $ notifiable = new NotificationSmsFactorSmsChannelTestNotifiable () ;
129128
130129 $ channel = new SmsFactorSmsChannel ();
131130
132131 $ this ->mock ('alias: ' .Message::class, function (MockInterface $ mock ) {
133132 $ mock ->shouldReceive ('send ' )
134133 ->with (
135134 [
136- 'to ' => '5555555555 ' ,
137- 'text ' => 'this is my message ' ,
138- 'delay ' => null ,
135+ 'to ' => '5555555555 ' ,
136+ 'text ' => 'this is my message ' ,
137+ 'delay ' => null ,
139138 'pushtype ' => null ,
140- 'sender ' => null ,
139+ 'sender ' => null ,
141140 'gsmsmsid ' => 'my-custom-id ' ,
142141 ]
143142 )
@@ -198,4 +197,4 @@ public function routeNotificationForSmsFactor($notification)
198197 {
199198 return $ this ->phone_number ;
200199 }
201- }
200+ }
0 commit comments