[EventDispatcher] fix RegisterListenersPass test

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | 
| License       | MIT
| Doc PR        | 

With #12088 being merged, the test needs to be adapted to reflect the 2.5 specific changes.