assertInstanceOf(AxeptaOrder::class, $order); } public function test_cannot_instanciate_an_axepta_order_with_empty_reference(): void { $this->assertThrows(function () { // GIVEN $reference = ''; $amount = 200; $email = 'valid-email@example.org'; // WHEN new AxeptaOrder( $reference, $amount, $email, ); // THEN }, DomainException::class); } public function test_cannot_instanciate_an_axepta_order_with_non_positive_amount(): void { $this->assertThrows(function () { // GIVEN $reference = 'IRDtm95jvhCN'; $amount = 0; $email = 'valid-email@example.org'; // WHEN new AxeptaOrder( $reference, $amount, $email, ); // THEN }, DomainException::class); } public function test_cannot_instanciate_an_axepta_order_with_invalid_email(): void { $this->assertThrows(function () { // GIVEN $reference = 'IRDtm95jvhCN'; $amount = 200; $email = 'invalid-email'; // WHEN new AxeptaOrder( $reference, $amount, $email, ); // THEN }, DomainException::class); } }