API reference / Quittio \ Laravel \ Testing
InteractsWithQuittio
trait in quittio/laravel
Quittio\Laravel\Testing\InteractsWithQuittio · Source
Assertions for feature tests.
Methods#
| Method | Description |
|---|---|
->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): voidReads the PDF or XML and validates it with all configured levels.
| Parameter | Type | Description |
|---|---|---|
$pdfOrXml | string | |
$profile | ?string = null |
assertXmlMatchesSnapshot()#
public function assertXmlMatchesSnapshot(string $xml, ?string $name = null): voidCompares XML with a stored snapshot (canonicalised); the first run writes it.
| Parameter | Type | Description |
|---|---|---|
$xml | string | |
$name | ?string = null |
quittioSnapshotDirectory()#
protected function quittioSnapshotDirectory(): string- Returns
string
quittioSnapshotName()#
protected function quittioSnapshotName(): string- Returns
string
tearDownInteractsWithQuittio()#
protected function tearDownInteractsWithQuittio(): voidCalled 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().