1
0
mirror of synced 2025-03-27 18:33:53 +03:00

fixed very simple support for subGrouping in tests

This commit is contained in:
meus 2007-09-02 17:55:42 +00:00
parent 63cba02028
commit 92e524885e
3 changed files with 13 additions and 7 deletions

View File

@ -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
return count($this->_testCases); return count($this->_testCases);
} }
public function getTestCases(){
return $this->_testCases;
}
} }
class HtmlReporter class HtmlReporter
{ {

View File

@ -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));
} }
}

View File

@ -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());