new API endpoint to save invoice meta-fields (#5916)

This commit is contained in:
Kevin Papst
2026-04-25 18:14:10 +02:00
committed by GitHub
parent 087350ab72
commit 3eebb02ad3
39 changed files with 1427 additions and 659 deletions

View File

@@ -18,6 +18,7 @@ use App\Entity\Timesheet;
use App\Invoice\Calculator\DefaultCalculator;
use App\Invoice\InvoiceItemRepositoryInterface;
use App\Invoice\InvoiceModel;
use App\Invoice\InvoiceService;
use App\Invoice\NumberGenerator\DateNumberGenerator;
use App\Invoice\Renderer\TwigRenderer;
use App\Invoice\ServiceInvoice;
@@ -29,12 +30,14 @@ use App\Tests\Mocks\InvoiceModelFactoryFactory;
use App\Utils\FileHelper;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Twig\Environment;
#[CoversClass(ServiceInvoice::class)]
class ServiceInvoiceTest extends TestCase
#[CoversClass(InvoiceService::class)]
#[CoversClass(ServiceInvoice::class)] // @phpstan-ignore-line
class InvoiceServiceTest extends TestCase
{
private function getSut(array $paths): ServiceInvoice
private function getSut(array $paths): InvoiceService
{
$languages = [
'en' => LocaleService::DEFAULT_SETTINGS
@@ -45,7 +48,14 @@ class ServiceInvoiceTest extends TestCase
$repo = new InvoiceDocumentRepository($paths);
$invoiceRepo = $this->createMock(InvoiceRepository::class);
return new ServiceInvoice($repo, new FileHelper(realpath(__DIR__ . '/../../var/data/')), $invoiceRepo, $formattings, (new InvoiceModelFactoryFactory($this))->create());
return new InvoiceService(
$repo,
new FileHelper(realpath(__DIR__ . '/../../var/data/')),
$invoiceRepo,
$formattings,
(new InvoiceModelFactoryFactory($this))->create(),
$this->createMock(EventDispatcherInterface::class)
);
}
public function testInvalidExceptionOnChangeState(): void