Created
July 5, 2011 08:33
-
-
Save jkulak/1064487 to your computer and use it in GitHub Desktop.
Randomize your PHP unit tests order by adding a shuffle.
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 | |
/** | |
* @author | |
*/ | |
require_once 'Config.php'; | |
class AllTests { | |
public static function suite() { | |
$suite = new PHPUnit_Framework_TestSuite('PHPUnit'); | |
$tests = array( | |
'FirstFileWithTest', | |
'SecondFileWithTest', | |
'ThirdFileWithTest', | |
'AndSoOnTest' | |
); | |
// randomize test order | |
shuffle($tests); | |
foreach ($tests as $key => $value) { | |
echo "[$key] $value \n"; | |
require_once $value . '.php'; | |
$suite->addTestSuite($value); | |
} | |
return $suite; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment