Skip to content

API reference / Quittio \ Laravel \ Testing

InteractsWithQuittio

trait in quittio/laravel

Quittio\Laravel\Testing\InteractsWithQuittio · Source

Assertions for feature tests.

Methods#

MethodDescription
->assertValidEInvoice()Reads the PDF or XML and validates it with all configured levels.
->assertXmlMatchesSnapshot()Compares XML with a stored snapshot (canonicalised); the first run writes it.
->quittioSnapshotDirectory()
->quittioSnapshotName()
->tearDownInteractsWithQuittio()Called by Laravel's test case after each test: forgets the process-wide state of Quittio (e.g. base rates registered by a test), see Quittio\Core\Quittio::resetState().

assertValidEInvoice()#

public function assertValidEInvoice(string $pdfOrXml, ?string $profile = null): void

Reads the PDF or XML and validates it with all configured levels.

ParameterTypeDescription
$pdfOrXmlstring
$profile?string = null

assertXmlMatchesSnapshot()#

public function assertXmlMatchesSnapshot(string $xml, ?string $name = null): void

Compares XML with a stored snapshot (canonicalised); the first run writes it.

ParameterTypeDescription
$xmlstring
$name?string = null

quittioSnapshotDirectory()#

protected function quittioSnapshotDirectory(): string

protected

Returns
string

quittioSnapshotName()#

protected function quittioSnapshotName(): string

protected

Returns
string

tearDownInteractsWithQuittio()#

protected function tearDownInteractsWithQuittio(): void

protected

Called by Laravel's test case after each test: forgets the process-wide state of Quittio (e.g. base rates registered by a test), see Quittio\Core\Quittio::resetState().

The open core packages are MIT licensed. The legal wording of the country packs must be confirmed by a tax adviser.