Meta-fields for InvoiceTemplate, structured Customer address (#5519)
This commit is contained in:
@@ -36,6 +36,12 @@ class InvoiceModelCustomerHydratorTest extends TestCase
|
||||
self::assertEquals([
|
||||
'customer.id' => null,
|
||||
'customer.address' => "Foo\nStreet\n1111 City",
|
||||
'customer.address_line1' => '',
|
||||
'customer.address_line2' => '',
|
||||
'customer.address_line3' => '',
|
||||
'customer.buyer_reference' => '',
|
||||
'customer.city' => '',
|
||||
'customer.postcode' => '',
|
||||
'customer.name' => 'customer,with/special#name',
|
||||
'customer.contact' => '',
|
||||
'customer.company' => '',
|
||||
@@ -43,6 +49,7 @@ class InvoiceModelCustomerHydratorTest extends TestCase
|
||||
'customer.vat_id' => '',
|
||||
'customer.number' => '',
|
||||
'customer.country' => 'AT',
|
||||
'customer.country_name' => 'Austria',
|
||||
'customer.homepage' => '',
|
||||
'customer.comment' => '',
|
||||
'customer.email' => '',
|
||||
@@ -63,12 +70,19 @@ class InvoiceModelCustomerHydratorTest extends TestCase
|
||||
$keys = [
|
||||
'customer.id',
|
||||
'customer.address',
|
||||
'customer.address_line1',
|
||||
'customer.address_line2',
|
||||
'customer.address_line3',
|
||||
'customer.buyer_reference',
|
||||
'customer.city',
|
||||
'customer.postcode',
|
||||
'customer.name',
|
||||
'customer.contact',
|
||||
'customer.company',
|
||||
'customer.vat',
|
||||
'customer.vat_id',
|
||||
'customer.country',
|
||||
'customer.country_name',
|
||||
'customer.number',
|
||||
'customer.homepage',
|
||||
'customer.comment',
|
||||
|
||||
@@ -33,12 +33,12 @@ class InvoiceModelDefaultHydratorTest extends TestCase
|
||||
public function testHydrateThrowsOnMissing(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('InvoiceModel needs a template');
|
||||
$this->expectExceptionMessage('InvoiceModel needs a calculator');
|
||||
|
||||
$model = $this->getInvoiceModel();
|
||||
|
||||
$obj = new ReflectionObject($model);
|
||||
$prop = $obj->getProperty('template');
|
||||
$prop = $obj->getProperty('calculator');
|
||||
$prop->setAccessible(true);
|
||||
$prop->setValue($model, null);
|
||||
|
||||
@@ -63,6 +63,7 @@ class InvoiceModelDefaultHydratorTest extends TestCase
|
||||
'invoice.tax_hide',
|
||||
'invoice.tax_nc',
|
||||
'invoice.tax_plain',
|
||||
'invoice.tax_rows',
|
||||
'invoice.total_time',
|
||||
'invoice.duration_decimal',
|
||||
'invoice.first',
|
||||
|
||||
Reference in New Issue
Block a user