Issue summary
The filter_var has the different behavior in the php-7.x versions.
System informations
- OS: Linux/Ubuntu 18.04.2 LTS
- PHP version:
php-7.1.30
Standalone code, or other way to reproduce the problem
Please consider following code snippets firstly:
It's for php-7.x:
filter_var('not-int', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1, 'default' => 20]]); // 20
It's for php-5.x:
filter_var('not-int', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1, 'default' => 20]]); // false
It effects the line 229 in src/Millipede.php class.
Expected result
The tests will be done and has the green message in php-7.x.
Actual result
The tests will have the failed assertion due to different filter_var behavior in different PHP versions.
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.
Runtime: PHP 7.1.30-1+ubuntu18.04.1+deb.sury.org+1 with Xdebug 2.7.1
Configuration: /data/millipede-php/phpunit.xml
.......F......F................................
Time: 389 ms, Memory: 6.00MB
There were 2 failures:
1) MillipedeTest\MillipedeTest::testSetSizeThrowsException
Failed asserting that exception of type "\InvalidArgumentException" is thrown.
2) MillipedeTest\MillipedeTest::testSetCurveThrowsException
Failed asserting that exception of type "\InvalidArgumentException" is thrown.
FAILURES!
Tests: 47, Assertions: 58, Failures: 2.
Once accepting this, I can solve this issue.
Issue summary
The
filter_varhas the different behavior in thephp-7.xversions.System informations
php-7.1.30Standalone code, or other way to reproduce the problem
Please consider following code snippets firstly:
It's for
php-7.x:It's for
php-5.x:It effects the line
229insrc/Millipede.phpclass.Expected result
The tests will be done and has the green message in
php-7.x.Actual result
The tests will have the failed assertion due to different
filter_varbehavior in differentPHPversions.Once accepting this, I can solve this issue.