File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ class AmericanExpress extends Card implements CreditCard
4646 *
4747 * @var array
4848 */
49- protected $ cvc_length = [3 , 4 ];
49+ protected $ cvc_length = [4 ];
5050
5151 /**
5252 * Test cvc code checksum against Luhn algorithm.
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ public function it_check_cvc_by_credit_card()
1717 $ this ->assertTrue ($ this ->validator ('243 ' )->passes ());
1818 $ this ->assertTrue ($ this ->validator ('1234 ' )->passes ());
1919
20+ $ this ->assertTrue ($ this ->validator ('1234 ' , new AmericanExpressTest )->passes ());
21+ $ this ->assertFalse ($ this ->validator ('243 ' , new AmericanExpressTest )->passes ()); // American Express supports only 4 digits
22+
2023 $ this ->assertTrue ($ this ->validator ('243 ' , new VisaTest )->passes ());
2124 $ this ->assertTrue ($ this ->validator ('1234 ' , new VisaTest )->fails ()); // Visa supports only 3 digits
2225
You can’t perform that action at this time.
0 commit comments