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 ea8cad5 commit 4c2cb30
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,10 +26,24 @@ public function getValidValues()
array('4903010000000009'), //Switch
array('4111111111111111'), //Visa
array('6304100000000008'), //Laser
array(6304100000000008), //Laser
);
}

/**
* {@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 4c2cb30

Please sign in to comment.