Returns the groups for a test class or method.
@since Method available since Release 3.2.0
string $className:
string $methodName:
array
public static function getGroups($className, $methodName = '') {
$annotations = self::parseTestMethodAnnotations($className, $methodName);
$groups = array();
if (isset($annotations['method']['author'])) {
$groups = $annotations['method']['author'];
}
else {
if (isset($annotations['class']['author'])) {
$groups = $annotations['class']['author'];
}
}
if (isset($annotations['class']['group'])) {
$groups = array_merge($groups, $annotations['class']['group']);
}
if (isset($annotations['method']['group'])) {
$groups = array_merge($groups, $annotations['method']['group']);
}
if (isset($annotations['class']['ticket'])) {
$groups = array_merge($groups, $annotations['class']['ticket']);
}
if (isset($annotations['method']['ticket'])) {
$groups = array_merge($groups, $annotations['method']['ticket']);
}
foreach (array(
'small',
'medium',
'large',
) as $size) {
if (isset($annotations['method'][$size])) {
$groups[] = $size;
}
else {
if (isset($annotations['class'][$size])) {
$groups[] = $size;
}
}
}
return array_unique($groups);
}