Created
February 8, 2012 23:39
-
-
Save cboden/1775473 to your computer and use it in GitHub Desktop.
Strange Failing Travis CI Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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') | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment