Constructs a new TestSuite:
mixed $theClass:
string $name:
Overrides PHPUnit_Framework_TestSuite::__construct
public function __construct(PHPUnit_Framework_TestSuite $suite, array $groups) {
$groupSuites = array();
$name = $suite
->getName();
foreach ($groups as $group) {
$groupSuites[$group] = new PHPUnit_Framework_TestSuite($name . ' - ' . $group);
$this
->addTest($groupSuites[$group]);
}
$tests = new RecursiveIteratorIterator(new PHPUnit_Util_TestSuiteIterator($suite), RecursiveIteratorIterator::LEAVES_ONLY);
foreach ($tests as $test) {
if ($test instanceof PHPUnit_Framework_TestCase) {
$testGroups = PHPUnit_Util_Test::getGroups(get_class($test), $test
->getName(FALSE));
foreach ($groups as $group) {
foreach ($testGroups as $testGroup) {
if ($group == $testGroup) {
$groupSuites[$group]
->addTest($test);
}
}
}
}
}
}