diff --git a/tests/Test.php b/tests/Test.php index 4b5fbdf76..2f73d4dfb 100644 --- a/tests/Test.php +++ b/tests/Test.php @@ -12,8 +12,13 @@ class GroupTest extends UnitTestCase public function addTestCase(UnitTestCase $testCase) { - $this->_testCases[] = $testCase; + if($testCase instanceOf GroupTest) { + $this->_testCases = array_merge($this->_testCases, $testCase->getTestCases()); + } else { + $this->_testCases[spl_object_hash($testCase)] = $testCase; + } } + public function run(HtmlReporter $reporter) { @@ -41,7 +46,9 @@ class GroupTest extends UnitTestCase return count($this->_testCases); } - + public function getTestCases(){ + return $this->_testCases; + } } class HtmlReporter { diff --git a/tests/Ticket/NjeroTestCase.php b/tests/Ticket/NjeroTestCase.php index e0cd54e8c..26d63b43b 100644 --- a/tests/Ticket/NjeroTestCase.php +++ b/tests/Ticket/NjeroTestCase.php @@ -84,3 +84,4 @@ class Doctrine_Ticket_Njero_TestCase extends Doctrine_UnitTestCase #echo "Values " . serialize(array($c, $c2, $c3)); } +} diff --git a/tests/run.php b/tests/run.php index 55000ccd0..7959b9a01 100644 --- a/tests/run.php +++ b/tests/run.php @@ -69,12 +69,10 @@ error_reporting(E_ALL | E_STRICT); $test = new GroupTest('Doctrine Framework Unit Tests'); - -// DATABASE ABSTRACTION tests - - //TICKET test cases -$test->addTestCase(new Doctrine_Ticket_Njero_TestCase()); +$tickets = new GroupTest('Tickets tests'); +$tickets->addTestCase(new Doctrine_Ticket_Njero_TestCase()); +$test->addTestCase($tickets); // Connection drivers (not yet fully tested) $test->addTestCase(new Doctrine_Connection_Pgsql_TestCase());