Adds a test to the suite.
PHPUnit_Framework_Test $test:
array $groups:
public function addTest(PHPUnit_Framework_Test $test, $groups = array()) {
$class = new ReflectionClass($test);
if (!$class
->isAbstract()) {
$this->tests[] = $test;
$this->numTests = -1;
if ($test instanceof PHPUnit_Framework_TestSuite && empty($groups)) {
$groups = $test
->getGroups();
}
if (empty($groups)) {
$groups = array(
'__nogroup__',
);
}
foreach ($groups as $group) {
if (!isset($this->groups[$group])) {
$this->groups[$group] = array(
$test,
);
}
else {
$this->groups[$group][] = $test;
}
}
}
}