feat: dummy replacement pdf upload for environments other than prod

This commit is contained in:
Björn Fromme
2026-03-15 12:42:28 +01:00
parent 3b99757a08
commit 8988ae7620
12 changed files with 78 additions and 16 deletions
+7 -1
View File
@@ -16,6 +16,7 @@ use App\Entity\User;
use App\Service\Pdf\InvoiceApprover;
use App\Service\Pdf\InvoiceRenderer;
use App\Service\Pdf\Pdf;
use App\Service\Upload\UploadHandler;
use Carbon\CarbonPeriod;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Contracts\Translation\TranslatorInterface;
@@ -108,8 +109,13 @@ class InvoiceRendererTest extends WebTestCase
;
$disposition->addDocument($invoice);
$invoicePath = $projectDir.'/uploads/invoice/a/abcdef0123456789.pdf';
$uploadHandler = $this->createMock(UploadHandler::class);
$uploadHandler->method('getResolvedUploadFilepath')->with($invoice)->willReturn($invoicePath);
$uploadHandler->method('getUploadFilepath')->with($invoice)->willReturn($invoicePath);
/** @var TranslatorInterface $translator */
$approver = new InvoiceApprover($translator, ['project_dir' => $projectDir]);
$approver = new InvoiceApprover($translator, ['project_dir' => $projectDir], $uploadHandler);
$pdf = $approver->render($disposition);
$this->assertInstanceOf(Pdf::class, $pdf);
}