fix RegisterListenersPass test

With #12088 being merged, the test needs to be adapted to reflect the
2.5 specific changes.
Merge branch '2.5'

* 2.5:
  fix RegisterListenersPass test