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)];
}
}
}