Release 2.33.0 (#5438)

This commit is contained in:
Kevin Papst
2025-04-22 20:43:22 +02:00
committed by GitHub
parent a70c803158
commit e663cc2b02
58 changed files with 1404 additions and 899 deletions

View File

@@ -12,6 +12,7 @@ namespace App\Tests\Invoice\Hydrator;
use App\Invoice\Hydrator\InvoiceModelDefaultHydrator;
use App\Tests\Invoice\Renderer\RendererTestTrait;
use PHPUnit\Framework\TestCase;
use ReflectionObject;
/**
* @covers \App\Invoice\Hydrator\InvoiceModelDefaultHydrator
@@ -30,6 +31,23 @@ class InvoiceModelDefaultHydratorTest extends TestCase
$this->assertModelStructure($result);
}
public function testHydrateThrowsOnMissing(): void
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('InvoiceModel needs a template');
$model = $this->getInvoiceModel();
$obj = new ReflectionObject($model);
$prop = $obj->getProperty('template');
$prop->setAccessible(true);
$prop->setValue($model, null);
$sut = new InvoiceModelDefaultHydrator();
$sut->hydrate($model);
}
protected function assertModelStructure(array $model, bool $hasProject = true): void
{
$keys = [
@@ -60,6 +78,8 @@ class InvoiceModelDefaultHydratorTest extends TestCase
'invoice.subtotal_plain',
'template.name',
'template.company',
'template.country',
'template.country_name',
'template.address',
'template.title',
'template.payment_terms',