Fixed
Project:
Matrix API
Version:
3.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Jun 2026 at 19:28 UTC
Updated:
28 Jun 2026 at 19:12 UTC
Jump to comment: Most recent
The module has no automated tests. The new MatrixClient API method implementations, the MatrixEvent token handling, and the inbound event deduplication logic are all
untested. This makes it difficult to verify correctness, prevent regressions, or accept contributions with confidence.
Run phpunit web/modules/contrib/matrix_api — no tests found.
Add PHPUnit unit tests covering the core classes:
tests/src/Unit/MatrixClientTest.php — tests for MatrixClient:
sendMessage() returns the event ID stringsendThreadReply() sends correct m.thread relation structureredactEvent() calls the correct endpointgetState() returns [] on 404 and false on other HTTP errorssetState() returns '' and logs a warning on 403tests/src/Unit/MatrixApiTokenTest.php — tests for MatrixEvent token replacement: verifies that all ECA tokens[matrix_event:body], [matrix_event:sender], [matrix_event:room-id], [matrix_event:event-id],[matrix_event:thread-root]) resolve correctly from a MatrixEvent object.tests/src/Event/ — tests for MatrixEvent typed accessors.None.
None.
None.
Comments
Comment #3
freelockTests added.