protected function getTestName(Event $e) { if ($e instanceof TestEvent || $e instanceof FailEvent) { $test = $e->getTest(); return method_exists($test, 'getSignature') ? $test->getSignature() : get_class($test) . ":{$test->getName(false)}"; } elseif ($e instanceof SuiteEvent) { return $e->getSuite()->getName(); } else { return $e->getName(); } }