Skip to content

Commit e7229ad

Browse files
committed
update RealSmsTest to include service and from configuration for SMSAPI
1 parent 9ec8205 commit e7229ad

File tree

1 file changed

+4
-34
lines changed

1 file changed

+4
-34
lines changed

tests/Feature/RealSmsTest.php

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
}
1313

1414
config(['smsapi.api_token' => env('SMSAPI_REAL_TOKEN')]);
15+
config(['smsapi.service' => env('SMSAPI_SERVICE')]);
16+
config(['smsapi.from' => env('SMSAPI_FROM')]);
1517

1618
$notification = new class extends Notification {
1719
public function via($notifiable): array
@@ -45,6 +47,8 @@ public function toSmsApi($notifiable): SmsApiMessage
4547
}
4648

4749
config(['smsapi.api_token' => env('SMSAPI_REAL_TOKEN')]);
50+
config(['smsapi.service' => env('SMSAPI_SERVICE')]);
51+
config(['smsapi.from' => env('SMSAPI_FROM')]);
4852

4953
$notification = new class extends Notification {
5054
public function via($notifiable): array
@@ -62,40 +66,6 @@ public function toSmsApi($notifiable): SmsApiMessage
6266

6367
$phoneNumber = env('TEST_PHONE_NUMBER', '+48123456789');
6468

65-
NotificationFacade::route('smsapi', $phoneNumber)
66-
->notify($notification);
67-
68-
expect(true)->toBeTrue();
69-
});
70-
71-
it('can send sms with template parameters', function () {
72-
if (empty(env('SMSAPI_REAL_TOKEN'))) {
73-
test()->markTestSkipped('SMSAPI_REAL_TOKEN not provided');
74-
}
75-
76-
config(['smsapi.api_token' => env('SMSAPI_REAL_TOKEN')]);
77-
78-
$notification = new class extends Notification {
79-
public function via($notifiable): array
80-
{
81-
return ['smsapi'];
82-
}
83-
84-
public function toSmsApi($notifiable): SmsApiMessage
85-
{
86-
return SmsApiMessage::create('Template test with params')
87-
->from('TestApp')
88-
->test(true)
89-
->template('welcome_template')
90-
->param1('John')
91-
->param2('Doe')
92-
->param3('123456')
93-
->param4('2025-07-02');
94-
}
95-
};
96-
97-
$phoneNumber = env('TEST_PHONE_NUMBER', '+48123456789');
98-
9969
NotificationFacade::route('smsapi', $phoneNumber)
10070
->notify($notification);
10171

0 commit comments

Comments
 (0)