Chris@16: Chris@16: * Chris@16: * For the full copyright and license information, please view the LICENSE Chris@16: * file that was distributed with this source code. Chris@16: */ Chris@16: Chris@16: namespace Symfony\Bridge\PhpUnit\Legacy; Chris@16: Chris@16: use PHPUnit\TextUI\TestRunner as BaseRunner; Chris@16: use Symfony\Bridge\PhpUnit\SymfonyTestsListener; Chris@16: Chris@16: /** Chris@16: * {@inheritdoc} Chris@16: * Chris@16: * @internal Chris@16: */ Chris@16: class TestRunnerForV7 extends BaseRunner Chris@16: { Chris@16: /** Chris@16: * {@inheritdoc} Chris@16: */ Chris@16: protected function handleConfiguration(array &$arguments): void Chris@16: { Chris@16: $listener = new SymfonyTestsListener(); Chris@16: Chris@16: parent::handleConfiguration($arguments); Chris@16: Chris@16: $arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array(); Chris@16: Chris@16: $registeredLocally = false; Chris@16: Chris@16: foreach ($arguments['listeners'] as $registeredListener) { Chris@16: if ($registeredListener instanceof SymfonyTestsListener) { Chris@16: $registeredListener->globalListenerDisabled(); Chris@16: $registeredLocally = true; Chris@16: break; Chris@16: } Chris@16: } Chris@16: Chris@16: if (!$registeredLocally) { Chris@16: $arguments['listeners'][] = $listener; Chris@16: } Chris@16: } Chris@16: }