public
Created

Strange Failing Travis CI Test

  • Download Gist
gistfile1.aw
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
<?php
 
/**
* The method that is being tested
*/
public function generateKeyNumber($key) {
// If there are no spaces, reject
if (0 === substr_count($key, ' ')) {
return '';
}
 
$int = (int)preg_replace('[\D]', '', $key) / substr_count($key, ' ');
 
return (is_int($int)) ? $int : '';
}
 
/*****/
 
/**
* The unit test
* @dataProvider KeyProvider
*/
public function testKeySigningForHandshake($accept, $key) {
$this->assertEquals($accept, $this->_version->generateKeyNumber($key));
}
 
public static function KeyProvider() {
return array(
array(179922739, '17 9 G`ZD9 2 2b 7X 3 /r90')
, array('', '17 9 G`ZD9 2 2b 7X 3 /r91')
 
// This test fails on Travis CI, with exact same environment as two other tested, passing envs
, array(906585445, '3e6b263 4 17 80')
 
, array('', '3e6b263 4 17 80')
, array('', '3e6b63 4 17 80')
, array('', '3e6b6341780')
);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.