From 42e76aa7a329a6a9188469f756f07085d3ffa366 Mon Sep 17 00:00:00 2001 From: meus Date: Sun, 2 Sep 2007 20:59:39 +0000 Subject: [PATCH] adding functionality to testrunnner to spscify both group name and classname on the command line --- tests/run.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/run.php b/tests/run.php index 7597fd562..129729031 100644 --- a/tests/run.php +++ b/tests/run.php @@ -341,7 +341,7 @@ $test->addTestCase(new Doctrine_Template_TestCase()); $test->addTestCase(new Doctrine_Import_Builder_TestCase()); $test->addTestCase(new Doctrine_Search_TestCase()); -*/ + */ //$test->addTestCase(new Doctrine_IntegrityAction_TestCase()); //$test->addTestCase(new Doctrine_AuditLog_TestCase()); @@ -377,7 +377,7 @@ class CliReporter extends HtmlReporter{ class MyReporter extends HtmlReporter { public function paintHeader() { - ?> +?> Doctrine Unit Tests @@ -419,28 +419,31 @@ class MyReporter extends HtmlReporter { if (PHP_SAPI === "cli") { $reporter = new CliReporter(); } else { - $reporter = new MyReporter(); + $reporter = new MyReporter(); } $argv = $_SERVER["argv"]; -$coverage = false; array_shift($argv); +$coverage = false; if(isset($argv[0]) && $argv[0] == "coverage"){ array_shift($argv); $coverage = true; - } +} if( ! empty($argv)) { $testGroup = new GroupTest("Custom"); foreach($argv as $group) { if( ! isset($$group)) { + if (class_exists($group)) { + $testGroup->addTestCase(new $group); + } die($group . " is not a valid group of tests\n"); } $testGroup->addTestCase($$group); - } - } else { - $testGroup = $test; - } + } +} else { + $testGroup = $test; +} if ($coverage) { xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); $testGroup->run($reporter);