feat(portal): lead module, WHMCS sync report/contacts/mapping, service lifecycle email templates
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
3c7710f1de
commit
a443ec3bf6
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Support\MailPlaceholders;
|
||||
use Tests\TestCase;
|
||||
|
||||
class MailPlaceholdersConditionalTest extends TestCase
|
||||
{
|
||||
public function test_block_is_kept_only_when_variable_has_value(): void
|
||||
{
|
||||
$content = 'A{{#if kyc_url}}<a href="{{kyc_url}}">KYC</a>{{else}}none{{/if}}B';
|
||||
|
||||
$this->assertSame('AnoneB', MailPlaceholders::fill($content, ['kyc_url' => ' ']));
|
||||
$this->assertSame('AnoneB', MailPlaceholders::fill($content, []));
|
||||
$this->assertSame('A<a href="https://x.vn/k?a=1&b=2">KYC</a>B', MailPlaceholders::fill($content, ['kyc_url' => 'https://x.vn/k?a=1&b=2']));
|
||||
}
|
||||
|
||||
public function test_extract_ignores_conditional_keywords(): void
|
||||
{
|
||||
$this->assertSame(['kyc_url'], MailPlaceholders::extract('{{#if kyc_url}}{{kyc_url}}{{else}}x{{/if}}'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user