diff --git a/src/Models/InvoiceDetails.php b/src/Models/InvoiceDetails.php index 54ae8b1..ba89880 100644 --- a/src/Models/InvoiceDetails.php +++ b/src/Models/InvoiceDetails.php @@ -872,9 +872,6 @@ public function setNotVAT195(?bool $notVAT195): static public function set($key, $value): static { if (($key === 'expensesClassification' || $key === 'incomeClassification') && !is_array($value)) { - if (!($value instanceof IncomeClassification || $value instanceof ExpensesClassification)) { - throw new InvalidArgumentException("Invalid value for key $key."); - } return $this->push($key, $value); } diff --git a/tests/InvoiceDetailsTest.php b/tests/InvoiceDetailsTest.php index 4f0c939..b752cac 100644 --- a/tests/InvoiceDetailsTest.php +++ b/tests/InvoiceDetailsTest.php @@ -12,9 +12,6 @@ use Firebed\AadeMyData\Models\IncomeClassification; use Firebed\AadeMyData\Models\Invoice; use Firebed\AadeMyData\Models\InvoiceDetails; -use Firebed\AadeMyData\Models\PaymentMethod; -use Firebed\AadeMyData\Models\Ship; -use InvalidArgumentException; use PHPUnit\Framework\TestCase; use Tests\Traits\HandlesInvoiceXml; @@ -146,13 +143,4 @@ public function test_it_converts_xml_to_invoice_rows(): void $this->assertEquals(1000, $ecls2->getAmount()); $this->assertEquals(3, $ecls2->getId()); } - - public function test_it_catches_invalid_classification_arguments() - { - $this->expectException(InvalidArgumentException::class); - - $details = new InvoiceDetails(); - $details->set('expensesClassification', new PaymentMethod()); - $details->set('incomeClassification', new Ship()); - } }