1
0
mirror of synced 2024-12-13 22:56:04 +03:00

adding functionality to testrunnner to spscify both group name and classname on the command line

This commit is contained in:
meus 2007-09-02 20:59:39 +00:00
parent 810b1d6623
commit 42e76aa7a3

View File

@ -423,8 +423,8 @@ if (PHP_SAPI === "cli") {
} }
$argv = $_SERVER["argv"]; $argv = $_SERVER["argv"];
$coverage = false;
array_shift($argv); array_shift($argv);
$coverage = false;
if(isset($argv[0]) && $argv[0] == "coverage"){ if(isset($argv[0]) && $argv[0] == "coverage"){
array_shift($argv); array_shift($argv);
$coverage = true; $coverage = true;
@ -434,6 +434,9 @@ if( ! empty($argv)) {
$testGroup = new GroupTest("Custom"); $testGroup = new GroupTest("Custom");
foreach($argv as $group) { foreach($argv as $group) {
if( ! isset($$group)) { if( ! isset($$group)) {
if (class_exists($group)) {
$testGroup->addTestCase(new $group);
}
die($group . " is not a valid group of tests\n"); die($group . " is not a valid group of tests\n");
} }
$testGroup->addTestCase($$group); $testGroup->addTestCase($$group);