Add feature tests for domain order management
- Implement AdminDomainOrderTest to cover admin functionalities for domain orders including listing, confirming registration, KYC updates, activation, rejection, and refunds. - Implement ClientDomainOrderTest to cover client functionalities for placing domain orders, including validation for balance, duplicate orders, and domain normalization. - Ensure proper handling of domain pricing and service statuses throughout the tests.
This commit is contained in:
@@ -26,7 +26,7 @@ class WebDesignQuotePdfService
|
||||
'companyAddress' => $settingValue->address ?? '',
|
||||
'companyPhone' => $settingValue->hotline ?? ($settingValue->tel ?? ''),
|
||||
'companyEmail' => $settingValue->email ?? '',
|
||||
'companyLogo' => $settingValue->logo ?? '',
|
||||
'companyLogo' => $this->resolvePdfImagePath($settingValue->logo ?? ''),
|
||||
'companyTaxCode' => $settingValue->tax ?? '',
|
||||
'brandColor' => $settingValue->brand_color ?? '#1a56db',
|
||||
];
|
||||
@@ -40,4 +40,27 @@ class WebDesignQuotePdfService
|
||||
{
|
||||
return 'Bao-gia-' . $quote->quote_number . '.pdf';
|
||||
}
|
||||
|
||||
private function resolvePdfImagePath(?string $path): string
|
||||
{
|
||||
if (!$path) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$urlPath = parse_url($path, PHP_URL_PATH) ?: $path;
|
||||
|
||||
if (str_starts_with($urlPath, '/storage/')) {
|
||||
$localPath = storage_path('app/public/' . ltrim(substr($urlPath, strlen('/storage/')), '/'));
|
||||
|
||||
return file_exists($localPath) ? $localPath : $path;
|
||||
}
|
||||
|
||||
if (str_starts_with($path, 'storage/')) {
|
||||
$localPath = storage_path('app/public/' . substr($path, strlen('storage/')));
|
||||
|
||||
return file_exists($localPath) ? $localPath : $path;
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user