Skip to content

Commit

Permalink
Test integer credit cards only on 64 bits system
Browse files Browse the repository at this point in the history
Integer credit card fails on 32bits system because the integer is too long.

Method for 64bits detection: http://stackoverflow.com/a/5424121/1731473
  • Loading branch information
soullivaneuh committed May 28, 2016
1 parent e20a08f commit f25295d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/IsoCodes/Tests/CreditCardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function getValidValues()
['4903010000000009'], //Switch
['4111111111111111'], //Visa
['6304100000000008'], //Laser
[6304100000000008], //Laser
['4917300800000000'], // VisaElectron
['6759649826438453'], // Maestro (long)
['6799990100000000019'], // maestro (short)
Expand All @@ -36,6 +35,21 @@ public function getValidValues()
];
}

/**
* {@inheritdoc}
*/
public function getLegacyValidValues()
{
$values = [];

// To be removed on 4.0.
if (8 === PHP_INT_SIZE) { // This test will success only on 64bits systems.
$values[] = [6304100000000008]; // Laser
}

return $values;
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit f25295d

Please sign in to comment.