public static function describe(PHPUnit_Framework_Test $test, $asString = true)
{
if ($asString) {
if ($test instanceof PHPUnit_Framework_SelfDescribing) {
return $test->toString();
} else {
return get_class($test);
}
} else {
if ($test instanceof PHPUnit_Framework_TestCase) {
return [get_class($test), $test->getName()];
} elseif ($test instanceof PHPUnit_Framework_SelfDescribing) {
return ['', $test->toString()];
} else {
return ['', get_class($test)];
}
}
}
/** * @return boolean */ public function accept() { $test = $this->getInnerIterator()->current(); if ($test instanceof PHPUnit_Framework_TestSuite) { return TRUE; } $tmp = PHPUnit_Util_Test::describe($test, FALSE); if ($tmp[0] != '') { $name = join('::', $tmp); } else { $name = $tmp[1]; } return preg_match($this->filter, $name); }