Commit 92e52488 authored by meus's avatar meus

fixed very simple support for subGrouping in tests

parent 63cba020
...@@ -12,8 +12,13 @@ class GroupTest extends UnitTestCase ...@@ -12,8 +12,13 @@ class GroupTest extends UnitTestCase
public function addTestCase(UnitTestCase $testCase) 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) public function run(HtmlReporter $reporter)
{ {
...@@ -41,7 +46,9 @@ class GroupTest extends UnitTestCase ...@@ -41,7 +46,9 @@ class GroupTest extends UnitTestCase
return count($this->_testCases); return count($this->_testCases);
} }
public function getTestCases(){
return $this->_testCases;
}
} }
class HtmlReporter class HtmlReporter
{ {
......
...@@ -84,3 +84,4 @@ class Doctrine_Ticket_Njero_TestCase extends Doctrine_UnitTestCase ...@@ -84,3 +84,4 @@ class Doctrine_Ticket_Njero_TestCase extends Doctrine_UnitTestCase
#echo "Values " . serialize(array($c, $c2, $c3)); #echo "Values " . serialize(array($c, $c2, $c3));
} }
}
...@@ -69,12 +69,10 @@ error_reporting(E_ALL | E_STRICT); ...@@ -69,12 +69,10 @@ error_reporting(E_ALL | E_STRICT);
$test = new GroupTest('Doctrine Framework Unit Tests'); $test = new GroupTest('Doctrine Framework Unit Tests');
// DATABASE ABSTRACTION tests
//TICKET test cases //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) // Connection drivers (not yet fully tested)
$test->addTestCase(new Doctrine_Connection_Pgsql_TestCase()); $test->addTestCase(new Doctrine_Connection_Pgsql_TestCase());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment