1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Fixes for tests

This commit is contained in:
David Bomba 2023-09-12 17:23:52 +10:00
parent dc4ccd57ca
commit 56744fc78c
3 changed files with 7 additions and 7 deletions

View File

@ -65,7 +65,7 @@ class BaseExport
'id_number' => 'vendor.id_number',
'name' => 'vendor.name',
'number' => 'vendor.number',
'client_phone' => 'vendor.phone',
'phone' => 'vendor.phone',
'postal_code' => 'vendor.postal_code',
'private_notes' => 'vendor.private_notes',
'public_notes' => 'vendor.public_notes',
@ -657,7 +657,7 @@ class BaseExport
// nlog("searching for {$column}");
$transformed_invoice = false;
if($transformer instanceof PaymentTransformer && ($entity->invoice ?? false)) {
if($transformer instanceof PaymentTransformer && ($entity->invoices ?? false)) {
$transformed_invoices = $transformer->includeInvoices($entity);
$manager = new Manager();

View File

@ -119,7 +119,7 @@ class VendorExport extends BaseExport
if (is_array($parts) && $parts[0] == 'vendor' && array_key_exists($parts[1], $transformed_vendor)) {
$entity[$key] = $transformed_vendor[$parts[1]];
} elseif (is_array($parts) && $parts[0] == 'vendor_contact' && array_key_exists($parts[1], $transformed_contact)) {
} elseif (is_array($parts) && $parts[0] == 'vendor_contact' && isset($transformed_contact[$parts[1]])) {
$entity[$key] = $transformed_contact[$parts[1]];
} else {
$entity[$key] = $this->resolveKey($key, $vendor, $this->vendor_transformer);

View File

@ -293,7 +293,7 @@ class ReportCsvGenerationTest extends TestCase
])->post('/api/v1/reports/vendors', $data);
$csv = $response->streamedContent();
nlog($csv);
$this->assertEquals('Vendor 1', $this->getFirstValueByColumn($csv, 'Vendor Name'));
$this->assertEquals('1234', $this->getFirstValueByColumn($csv, 'Vendor Number'));
$this->assertEquals('city', $this->getFirstValueByColumn($csv, 'Vendor City'));
@ -345,9 +345,9 @@ class ReportCsvGenerationTest extends TestCase
$csv = $response->streamedContent();
$this->assertEquals('Vendor 1', $this->getFirstValueByColumn($csv, 'Name'));
$this->assertEquals('1234', $this->getFirstValueByColumn($csv, 'Number'));
$this->assertEquals('city', $this->getFirstValueByColumn($csv, 'City'));
$this->assertEquals('Vendor 1', $this->getFirstValueByColumn($csv, 'Vendor Name'));
$this->assertEquals('1234', $this->getFirstValueByColumn($csv, 'Vendor Number'));
$this->assertEquals('city', $this->getFirstValueByColumn($csv, 'Vendor City'));
}