fix RegisterListenersPass test

With #12088 being merged, the test needs to be adapted to reflect the
2.5 specific changes.
minor #12093 [EventDispatcher] fix RegisterListenersPass test (xabbuh)

This PR was merged into the 2.5 branch.

Discussion
----------

[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.

Commits
-------

9d2120b fix RegisterListenersPass test