respect-validation/tests/unit
bmorg 34cbed2c9b
Allow leading zeros when using "IntVal" rule
There is some confusion about integer literals (as we type them into
source code) and integer values (the actual value they represent).

When casting the integer 08 (without quotes), PHP triggers an error as
integers starting with 0 should have base 8. However, when casting the
string '08' as an integer PHP returns the integer 8.

This commit will change the behavior of the "IntVal" rule, allowing it
to accept any integer type and any representation of an integer as a
string.

Reviewed-by: Emmerson Siqueira <emmersonsiqueira@gmail.com>
Reviewed-by: Wesley Victhor Mendes Santiago <w.v.mendes.s@gmail.com>
Co-authored-by: Henrique Moody <henriquemoody@gmail.com>
2020-07-21 21:40:38 +02:00
..
Exceptions Turn LICENSE file into plain/text 2019-05-23 16:21:34 +02:00
Helpers Turn LICENSE file into plain/text 2019-05-23 16:21:34 +02:00
Rules Allow leading zeros when using "IntVal" rule 2020-07-21 21:40:38 +02:00
FactoryTest.php Turn LICENSE file into plain/text 2019-05-23 16:21:34 +02:00
ValidatorTest.php Turn LICENSE file into plain/text 2019-05-23 16:21:34 +02:00