fixed very simple support for subGrouping in tests
This commit is contained in:
parent
63cba02028
commit
92e524885e
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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);
|
|||||||
$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());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user