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:
hamed
2026-07-08 00:03:33 +03:30
parent 2982eaa7e3
commit a2c809b7de
21 changed files with 1092 additions and 840 deletions
+6 -1
View File
@@ -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