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 14, 2016
1 parent 1479765 commit d20e0fb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/IsoCodes/Tests/CreditCardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CreditCardTest extends AbstractIsoCodeInterfaceTest
*/
public function getValidValues()
{
return array(
$values = array(
array('340000000000009'), //American Express
array('30000000000004'), //Carte Blanche
array('6011000000000004'), //Discover
Expand All @@ -26,8 +26,12 @@ public function getValidValues()
array('4903010000000009'), //Switch
array('4111111111111111'), //Visa
array('6304100000000008'), //Laser
array(6304100000000008), //Laser
);

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

/**
Expand Down

0 comments on commit d20e0fb

Please sign in to comment.