Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In #2895487: [Symfony 4] ContainerAwareEventDispatcherTest depends on Symfony tests We adjusted Drupal\Tests\Component\EventDispatcher\ContainerAwareEventDispatcherTest to extend Symfony's AbstractEventDispatcherTest for a few reasons, including being compatible with Symfony 4. Now, in Symfony 4 Beta 1, AbstractEventDispatcherTest has gone away and been rolled into Symfony's EventDispatcherTest. We should roll AbstractEventDispatcherTest into our event dispatcher test so we don't depend on Symfony anymore.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#9 | 3055040-9.drupal.Roll-AbstractEventDispatcherTest-into-ContainerAwareEventDispatcherTest.patch | 18.33 KB | mikelutz |
Comments
Comment #2
mikelutzhttps://www.drupal.org/project/drupal/issues/2895487
Comment #3
mikelutzComment #4
Gábor HojtsyComment #5
alexpottThis can uncomment and remove the @see in \Drupal\Core\Composer\Composer::$packageToCleanup
Comment #6
mikelutzComment #7
alexpott72% => most :)
Comment #8
mikelutzFor the record, I counted lines and actually did the math. :-p
Comment #9
mikelutzComment #10
jibranSeems like @alexpott is on board with this change. This test has been problematic to fix in the past. This RTBC for now but I hope one day we'll find a way to remove this test.
Comment #11
alexpottI totally believe that - but also I didn't want to try to maintain that number as further changes might be made to the test.
Comment #12
alexpottI think given that \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher is 100% Drupal code having the test be all Drupal makes sense. Can we open a follow-up to make the test confirm to Drupal's standards - there's no point maintaining something in the Drupal code base in the Symfony style that has no corollary in Symfony 4.
Comment #14
jibranComment #15
alexpottThe fail in #13 is due to #3059022: If Vimeo is down our tests break.
Comment #16
alexpottCommitted 0356445 and pushed to 8.8.x. Thanks!
Fixed unused use and use a FQCN for the reference.
Comment #18
alexpottCreated the follow-up - #3059079: Make ContainerAwareEventDispatcherTest use Drupal coding standards
Comment #19
mikelutzFYI, the only reason I didn't switch to Drupal standards In this issue was because we are likely to need to make changes one way or another in the 8.8 cycle for the event dispatcher, to prep for Drupal 9 and Symfony 5. Symfony 4 has a newer version of the test classes, which might work for us if we end up chosing to adapt ours in a similar way to the way Symfony did in 4.3, in which case I didn't want to reformat twice, I was hoping to have a plan for the dispatcher in place first.