General fixes for PR#1392 (rupay card validation)

This commit is contained in:
Alexandre Gomes Gaigalas 2023-02-13 18:58:16 -03:00
parent 8e345b798a
commit 2951dfd342
3 changed files with 4 additions and 3 deletions

View file

@ -19,6 +19,7 @@
- Added ignores for phpstan template variables without getters.
- Fixed misc phpstan and phpcs errors.
- v::dateTime('z') is not supported anymore in PHP8, and should not be relied upon
- Added RuPay card validation (thanks @rakshit087)
# Changes in Respect\Validation 1.0

View file

@ -103,4 +103,4 @@ final class CreditCard extends AbstractRule
return preg_match(self::BRAND_REGEX_LIST[$this->brand], $input) > 0;
}
}
}

View file

@ -35,7 +35,7 @@ final class CreditCardTest extends RuleTestCase
public function itShouldThrowExceptionWhenCreditCardBrandIsNotValid(): void
{
$message = '"RespectCard" is not a valid credit card brand';
$message .= ' (Available: Any, American Express, Diners Club, Discover, JCB, MasterCard, Visa)';
$message .= ' (Available: Any, American Express, Diners Club, Discover, JCB, MasterCard, Visa, RuPay)';
$this->expectException(ComponentException::class);
$this->expectExceptionMessage($message);
@ -108,4 +108,4 @@ final class CreditCardTest extends RuleTestCase
[$jcb, '38520000023237'], // Diners Club
];
}
}
}