Fixes for tests

This commit is contained in:
David Bomba 2024-06-07 12:02:33 +10:00
parent 56ad60afb0
commit 4b546bb206
2 changed files with 14 additions and 9 deletions

8
composer.lock generated
View File

@ -5076,12 +5076,12 @@
"source": {
"type": "git",
"url": "https://github.com/invoiceninja/einvoice.git",
"reference": "5ada5e64ee84137dbd5736e4b1c8da7661a8dc97"
"reference": "dd2a36b9efce85cf58d3bb1d718d75f2395c8761"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/invoiceninja/einvoice/zipball/5ada5e64ee84137dbd5736e4b1c8da7661a8dc97",
"reference": "5ada5e64ee84137dbd5736e4b1c8da7661a8dc97",
"url": "https://api.github.com/repos/invoiceninja/einvoice/zipball/dd2a36b9efce85cf58d3bb1d718d75f2395c8761",
"reference": "dd2a36b9efce85cf58d3bb1d718d75f2395c8761",
"shasum": ""
},
"require": {
@ -5123,7 +5123,7 @@
"source": "https://github.com/invoiceninja/einvoice/tree/main",
"issues": "https://github.com/invoiceninja/einvoice/issues"
},
"time": "2024-06-07T01:16:28+00:00"
"time": "2024-06-07T02:01:13+00:00"
},
{
"name": "invoiceninja/inspector",

View File

@ -126,20 +126,25 @@ class FatturaPATest extends TestCase
$this->assertInstanceOf(FatturaElettronicaBody::class, $fe->FatturaElettronicaBody[0]);
$this->assertInstanceOf(FatturaElettronicaHeader::class, $fe->FatturaElettronicaHeader);
$e = new EInvoice;
$errors = $e->validate($fe);
if(count($errors) > 0)
nlog($errors);
$this->assertCount(0, $errors);
$encoder = new Encode($fe);
$xml = $encoder->toXml();
$xml = $e->encode($fe, 'xml');
$this->assertNotNull($xml);
nlog($xml);
$json = $e->encode($fe, 'json');
$this->assertNotNull($json);
nlog($json);
$decode = $e->decode('FatturaPA', $json, 'json');
$this->assertInstanceOf(FatturaElettronica::class, $decode);
}
}