API reference / Quittio \ Core \ Testing
InvoiceFactory
final class in quittio/core
Quittio\Core\Testing\InvoiceFactory · Source
Test data factory: InvoiceData::factory()->reverseCharge()->withLines(5)->make().
Deterministic (no random values), so that snapshots stay stable.
Methods#
| Method | Description |
|---|---|
->b2c() | |
->builder() | |
->calculated() | Invoice data with totals and VAT breakdown, calculated with $calculator (default: En16931Calculator). |
->creditNote() | |
->currency() | |
->export() | |
->intraCommunity() | |
->make() | Uncalculated invoice data. |
::new() | |
->number() | |
->reverseCharge() | |
->state() | Free modification of the builder. |
->withLines() |
b2c()#
public function b2c(): self- Returns
self
builder()#
public function builder(): InvoiceBuilder- Returns
InvoiceBuilder
calculated()#
public function calculated(?TotalsCalculator $calculator = null): InvoiceDataInvoice data with totals and VAT breakdown, calculated with $calculator (default: En16931Calculator).
| Parameter | Type | Description |
|---|---|---|
$calculator | ?TotalsCalculator = null |
- Returns
InvoiceData
creditNote()#
public function creditNote(): self- Returns
self
currency()#
public function currency(string $currency): self| Parameter | Type | Description |
|---|---|---|
$currency | string |
- Returns
self
export()#
public function export(): self- Returns
self
intraCommunity()#
public function intraCommunity(): self- Returns
self
make()#
public function make(): InvoiceDataUncalculated invoice data.
- Returns
InvoiceData
new()#
public static function new(): self- Returns
self
number()#
public function number(string $number): self| Parameter | Type | Description |
|---|---|---|
$number | string |
- Returns
self
reverseCharge()#
public function reverseCharge(): self- Returns
self
state()#
public function state(callable $state): selfFree modification of the builder.
| Parameter | Type | Description |
|---|---|---|
$state | callable |
- Returns
self
withLines()#
public function withLines(int $count): self| Parameter | Type | Description |
|---|---|---|
$count | int |
- Returns
self