diff --git a/CHANGELOG.md b/CHANGELOG.md index 851e232e..12fcea3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/library/Rules/CreditCard.php b/library/Rules/CreditCard.php index cb3294e0..03057d4a 100644 --- a/library/Rules/CreditCard.php +++ b/library/Rules/CreditCard.php @@ -103,4 +103,4 @@ final class CreditCard extends AbstractRule return preg_match(self::BRAND_REGEX_LIST[$this->brand], $input) > 0; } -} \ No newline at end of file +} diff --git a/tests/unit/Rules/CreditCardTest.php b/tests/unit/Rules/CreditCardTest.php index 3b9af2ea..8705ec30 100644 --- a/tests/unit/Rules/CreditCardTest.php +++ b/tests/unit/Rules/CreditCardTest.php @@ -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 ]; } -} \ No newline at end of file +}