Add SmsServiceLookupOnlyTest AST and migration for template_code in sms_logs
- Created a new AST JSON file for SmsServiceLookupOnlyTest.php, detailing nodes, edges, and raw calls for better code analysis. - Added a new migration (Version20260707202553) to alter the sms_logs table by adding a nullable template_code column.
This commit is contained in:
@@ -71,7 +71,10 @@ class SmsServiceLookupOnlyTest extends TestCase
|
||||
$this->kavenegar->expects($this->once())->method('sendTemplate')
|
||||
->with('09120000000', 'clinicpro-otp', ['token' => '1234'])
|
||||
->willReturn(true);
|
||||
$this->logRepo->expects($this->once())->method('save');
|
||||
|
||||
$captured = null;
|
||||
$this->logRepo->expects($this->once())->method('save')
|
||||
->willReturnCallback(function (SmsLog $log) use (&$captured) { $captured = $log; });
|
||||
|
||||
$msg = new SendSmsMessage(
|
||||
'09120000000', 'code 1234', 'kavenegar',
|
||||
@@ -79,6 +82,8 @@ class SmsServiceLookupOnlyTest extends TestCase
|
||||
);
|
||||
|
||||
$this->assertTrue($this->service->sendNow($msg));
|
||||
// template بهکاررفته باید در SmsLog ثبت شود تا در پنل ادمین دیده شود.
|
||||
$this->assertSame('clinicpro-otp', $captured->toArray()['template_code']);
|
||||
}
|
||||
|
||||
public function testDispatchTemplateForTagWithoutTemplateDoesNotEnqueueAndLogsFailure(): void
|
||||
|
||||
Reference in New Issue
Block a user