do not register the test listener twice
If the listener is already configured through the PHPUnit config, there is no need to also enable it explicitly in the test runner.
This commit is contained in:
parent
e0568d8214
commit
f7bdfd068f
@ -23,9 +23,16 @@ class TestRunner extends \PHPUnit_TextUI_TestRunner
|
||||
*/
|
||||
protected function handleConfiguration(array &$arguments)
|
||||
{
|
||||
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
|
||||
$arguments['listeners'][] = new SymfonyTestsListener();
|
||||
$listener = new SymfonyTestsListener();
|
||||
|
||||
return parent::handleConfiguration($arguments);
|
||||
$result = parent::handleConfiguration($arguments);
|
||||
|
||||
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
|
||||
|
||||
if (!array_filter($arguments['listeners'], function ($listener) { return $listener instanceof SymfonyTestsListener; })) {
|
||||
$arguments['listeners'][] = $listener;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user