Typecast bug fix
Attempted to fix Travis CI failing unit test with typecasting
This commit is contained in:
parent
f666ed95bc
commit
a4b0990961
@ -53,11 +53,11 @@ class Hixie76 implements VersionInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function generateKeyNumber($key) {
|
public function generateKeyNumber($key) {
|
||||||
if (0 === mb_substr_count($key, ' ')) {
|
if (0 === substr_count($key, ' ')) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$int = preg_replace('[\D]', '', $key) / mb_substr_count($key, ' ');
|
$int = (int)preg_replace('[\D]', '', $key) / substr_count($key, ' ');
|
||||||
|
|
||||||
return (is_int($int)) ? $int : '';
|
return (is_int($int)) ? $int : '';
|
||||||
}
|
}
|
||||||
|
@ -41,9 +41,9 @@ class Hixie76Test extends \PHPUnit_Framework_TestCase {
|
|||||||
|
|
||||||
public static function KeyProvider() {
|
public static function KeyProvider() {
|
||||||
return array(
|
return array(
|
||||||
array('179922739', '17 9 G`ZD9 2 2b 7X 3 /r90')
|
array(179922739, '17 9 G`ZD9 2 2b 7X 3 /r90')
|
||||||
, array('', '17 9 G`ZD9 2 2b 7X 3 /r91')
|
, array('', '17 9 G`ZD9 2 2b 7X 3 /r91')
|
||||||
, array('906585445', '3e6b263 4 17 80')
|
, array(906585445, '3e6b263 4 17 80')
|
||||||
, array('', '3e6b263 4 17 80')
|
, array('', '3e6b263 4 17 80')
|
||||||
, array('', '3e6b63 4 17 80')
|
, array('', '3e6b63 4 17 80')
|
||||||
, array('', '3e6b6341780')
|
, array('', '3e6b6341780')
|
||||||
|
Loading…
Reference in New Issue
Block a user