feat: send accepted teamer invoices to configurable email inbox

This commit is contained in:
Björn Fromme
2026-03-15 12:42:28 +01:00
parent 3cb5b065f4
commit 3b99757a08
13 changed files with 648 additions and 4 deletions
+37
View File
@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
namespace App\Tests\Model;
use App\Model\EmailAttachmentDto;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
class EmailAttachmentDtoTest extends TestCase
{
public function testAttachToAddsContentAttachment(): void
{
$dto = new EmailAttachmentDto('invoice.pdf', 'pdf-content', 'application/pdf');
$email = new TemplatedEmail();
$dto->attachTo($email);
$attachments = $email->getAttachments();
$this->assertCount(1, $attachments);
$body = $attachments[0]->getBody();
$this->assertSame('pdf-content', $body);
$this->assertSame('invoice.pdf', $attachments[0]->getFilename());
$this->assertSame('application/pdf', $attachments[0]->getMediaType().'/'.$attachments[0]->getMediaSubtype());
}
public function testGettersReturnConstructorValues(): void
{
$dto = new EmailAttachmentDto('test.csv', 'csv-data', 'text/csv');
$this->assertSame('test.csv', $dto->getName());
$this->assertSame('csv-data', $dto->getContent());
$this->assertSame('text/csv', $dto->getMimeType());
}
}