Issue #3052625 by Mile23, alexpott: DeprecationListenerTrait croaks on tests with no results
parent
6483dcdefb
commit
50a5f02e2e
|
@ -175,6 +175,9 @@ trait DeprecationListenerTrait {
|
|||
// SymfonyTestsListenerTrait has its own error handler that needs to be
|
||||
// removed before this one.
|
||||
$test_result_object = $test->getTestResultObject();
|
||||
// It's possible that a test does not have a result object. This can happen
|
||||
// when a test class does not have any test methods.
|
||||
if ($test_result_object) {
|
||||
$reflection_class = new \ReflectionClass($test_result_object);
|
||||
$reflection_property = $reflection_class->getProperty('listeners');
|
||||
$reflection_property->setAccessible(TRUE);
|
||||
|
@ -182,5 +185,6 @@ trait DeprecationListenerTrait {
|
|||
$listeners[] = new AfterSymfonyListener();
|
||||
$reflection_property->setValue($test_result_object, $listeners);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue