Skip to content

Commit

Permalink
Update exception messages in VAT validation tests
Browse files Browse the repository at this point in the history
Changed exception messages to use standardized keys in VatNumberTest, VatNumberFormatTest, and VatNumberExistTest. This aligns test expectations with the updated validation message structure of the laravelVatEuValidator.
  • Loading branch information
dualklip authored and danielebarbaro committed Sep 16, 2024
1 parent 2cfd842 commit acad0b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/Rules/VatNumberExistTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testVatNumberDoesNotExist(): void
->andReturn(false);

$this->expectException(\Exception::class);
$this->expectExceptionMessage('VAT number :attribute not exist.');
$this->expectExceptionMessage('laravelVatEuValidator::validation.vat_number_exist');

$rule->validate('vat_number_exist', $fake_vat, static function ($message): never {
throw new \Exception($message);
Expand Down
2 changes: 1 addition & 1 deletion tests/Rules/VatNumberFormatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testVatNumberFormatNotExist(): void
->andReturn(false);

$this->expectException(\Exception::class);
$this->expectExceptionMessage('The :attribute must be write in a valid number format {country_name}{vat_number}.');
$this->expectExceptionMessage('laravelVatEuValidator::validation.vat_number_format');

$rule->validate('vat_number_format', $fake_vat, static function ($message): never {
throw new \Exception($message);
Expand Down
2 changes: 1 addition & 1 deletion tests/Rules/VatNumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testVatNumberNotExist(): void
->andReturn(false);

$this->expectException(\Exception::class);
$this->expectExceptionMessage('The :attribute must be a valid VAT number.');
$this->expectExceptionMessage('laravelVatEuValidator::validation.vat_number');

$rule->validate('vat_number', $fake_vat, static function ($message): never {
throw new \Exception($message);
Expand Down

0 comments on commit acad0b7

Please sign in to comment.