Summary
The six avathar.recenttopicsav.* events and three paybas.recenttopics.* deprecated aliases documented in contrib/Events.md have no executable verification. Any refactor of core/recenttopics.php could silently break the public API that downstream extensions depend on.
What to test
For each emitted event (sql_pull_topics_list, sql_pull_topics_data, modify_topics_list, topictitle_remove_re, modify_topictitle, modify_tpl_ary):
- Event fires — the dispatcher receives a
trigger_event call with the exact event name
- Correct variables are present — the event data contains the documented keys
- Modifications are picked up — a listener that modifies a variable has its changes reflected in the output after
extract() (proves the API contract end-to-end)
For the three paybas.recenttopics.* aliases additionally verify:
- They fire after their
avathar.recenttopicsav.* counterpart
- Changes made by a new-style listener are visible to the legacy listener (shared state through sequential
extract())
Approach
Use a real phpbb\event\dispatcher with inline listeners registered in the test, exercising core\recenttopics directly. No need for a full database — mock the DB and inject fixture data where needed.
Why this matters
contrib/Events.md is the documented API contract. These tests are the executable version of that contract. Without them a variable rename or a moved trigger_event call breaks every downstream extension with no CI failure.
References
contrib/Events.md — full event documentation
core/recenttopics.php lines 588, 645, 705, 792, 802, 873 — event dispatch locations
Summary
The six
avathar.recenttopicsav.*events and threepaybas.recenttopics.*deprecated aliases documented incontrib/Events.mdhave no executable verification. Any refactor ofcore/recenttopics.phpcould silently break the public API that downstream extensions depend on.What to test
For each emitted event (
sql_pull_topics_list,sql_pull_topics_data,modify_topics_list,topictitle_remove_re,modify_topictitle,modify_tpl_ary):trigger_eventcall with the exact event nameextract()(proves the API contract end-to-end)For the three
paybas.recenttopics.*aliases additionally verify:avathar.recenttopicsav.*counterpartextract())Approach
Use a real
phpbb\event\dispatcherwith inline listeners registered in the test, exercisingcore\recenttopicsdirectly. No need for a full database — mock the DB and inject fixture data where needed.Why this matters
contrib/Events.mdis the documented API contract. These tests are the executable version of that contract. Without them a variable rename or a movedtrigger_eventcall breaks every downstream extension with no CI failure.References
contrib/Events.md— full event documentationcore/recenttopics.phplines 588, 645, 705, 792, 802, 873 — event dispatch locations