email support

This commit is contained in:
Simon Pocrnjič
2025-10-11 17:20:05 +02:00
parent 7c7defb6c5
commit 1b615163be
23 changed files with 3183 additions and 28 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
use App\Http\Controllers\Admin\EmailTemplateController;
it('adds src to img when a /storage URL appears shortly after the tag', function () {
$controller = new EmailTemplateController;
$input = <<<HTML
<div>
<img alt="Logo" width="300" style="display:block;margin:0 auto 16px">
\n\n
https://localhost/storage/email-images/logo.png
</div>
HTML;
$ref = new ReflectionClass($controller);
$method = $ref->getMethod('repairImgWithoutSrc');
$method->setAccessible(true);
/** @var string $output */
$output = $method->invoke($controller, $input);
expect($output)->toContain('src="https://localhost/storage/email-images/logo.png"');
});