assertInstanceOf(AxeptaOrder::class, $order); } public function testCannotInstanciateAnAxeptaOrderWithEmptyReference(): void { $this->assertThrows(function () { // GIVEN $reference = ''; $amount = 200; $email = 'valid-email@example.org'; // WHEN new AxeptaOrder( $reference, $amount, $email, ); // THEN }, DomainException::class); } public function testCannotInstanciateAnAxeptaOrderWithNonPositiveAmount(): 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 testCannotInstanciateAnAxeptaOrderWithInvalidEmail(): void { $this->assertThrows(function () { // GIVEN $reference = 'IRDtm95jvhCN'; $amount = 200; $email = 'invalid-email'; // WHEN new AxeptaOrder( $reference, $amount, $email, ); // THEN }, DomainException::class); } }