diff --git a/src/Factories/InvoiceDetailsFactory.php b/src/Factories/InvoiceDetailsFactory.php index a0c13f9..ee29abb 100644 --- a/src/Factories/InvoiceDetailsFactory.php +++ b/src/Factories/InvoiceDetailsFactory.php @@ -25,7 +25,7 @@ class InvoiceDetailsFactory extends Factory public function definition(): array { return [ - 'lineNumber' => fake()->unique()->randomNumber(), + 'lineNumber' => fake()->randomDigitNotZero(), 'recType' => fake()->randomElement(RecType::cases()), 'TaricNo' => fake()->bothify('???###??##'), 'itemCode' => fake()->bothify('??##??'), diff --git a/tests/InvoiceTest.php b/tests/InvoiceTest.php index dd84cdc..b15cc84 100644 --- a/tests/InvoiceTest.php +++ b/tests/InvoiceTest.php @@ -60,7 +60,7 @@ public function test_invoice_validation_fail() $invoice = Invoice::factory()->make(); $invoice->getInvoiceHeader()->setInvoiceType("wrong"); $invoice->getInvoiceSummary()->setTotalGrossValue(-10); - + // "wrong" value will be cast to null because InvoiceType enum does // not have "wrong" value. // Since null values are stripped from the array, we expect a failure