Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Read PHPUnit configuration to check for listeners too#31649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| $configuration = Configuration::getInstance($this->arguments['configuration']); | ||
| } | ||
| foreach ($configuration->getListenerConfiguration()as$registeredListener) { | ||
| if (is_subclass_of($registeredListener['class'], SymfonyTestsListenerForV5::class)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ForV6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
orSymfony\Bridge\PhpUnit\SymfonyTestsListener in both classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yeah that was a mistake. Interestingly whilst debugging this locally doingis_subclass_of($registeredListener['class'], SymfonyTestsListener::class) was not working even though
$registeredListener['class'] wasSymfony\Bridge\PhpUnit\SymfonyTestsListener ?!?!?
nicolas-grekas commentedMay 29, 2019
Should target 3.4 since it's a bug fix? |
nicolas-grekas commentedJul 30, 2019
@greg0ire maybe you'd have some time to take over this PR? It'd be great :) |
greg0ire commentedJul 30, 2019
I'll give it a look :) |
greg0ire commentedAug 3, 2019
@alexpotthttps://www.drupal.org/project/drupal/issues/303934 gives me a 404 |
The listener can be registered via configuration by the user. In thatcase, we do not want to add it again to the list of listeners.Closessymfony#31649
The listener can be registered via configuration by the user. In thatcase, we do not want to add it again to the list of listeners.Closessymfony#31649
The bridge listener can be registered via configuration by the user. In thatcase, we do not want to add it again to the list of listeners.Closessymfony#31649
The bridge listener can be registered via configuration by the user. In thatcase, we do not want to add it again to the list of listeners.Closessymfony#31649
fabpot commentedAug 9, 2019
closing in favor of#32903 |
The bridge listener can be registered via configuration by the user. In thatcase, we do not want to add it again to the list of listeners.Closessymfony#31649
This PR was merged into the 3.4 branch.Discussion----------[PHPUnit Bridge] Avoid registering listener twiceThe listener can be registered via configuration by the user. In thatcase, we do not want to add it again to the list of listeners.Closes#31649| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR | n/aCommits-------b190536 Check phpunit configuration for listeners
Trying to use simple-phpunit to get around phpunit dependency fun and support many versions of PHP in Drupal. Seehttps://www.drupal.org/project/drupal/issues/303934. We're running into an issue that we register the Symfony event listener in our phpunit.xml file. We need to do this because we wrap your listener and intercept some deprecations. Without this fix the symfony tests listener gets registered twice.