framework/tests
Alexander Skvortsov 9b2d7856d1
Add subscribe method to event extender (#2535)
Historically, extensions using subscribers has caused problems because subscribers were constructed/applied at extension boot. This caused some classes (e.g. UrlGenerator) to be resolved early, breaking parts of Flarum. For this reason, subscriber support wasn't included in the initial version of the Event extender.

However, updating extensions has shown that there is a legitimate use case for subscribers in organizing clean code; for instance, core's own `DiscussionMetadataUpdater`.

This commit introduces support for subscribers, but only applies them after the app has booted, which avoids the early resolution issues. Since event listeners/subscribers are only intended to be used with domain events, which would never be dispatched during app boot, the late activation of subscribers should not cause issue.
2021-01-15 20:33:29 -05:00
..
fixtures View Extender (add namespace) (#2134) 2020-07-17 11:59:00 +02:00
integration Add subscribe method to event extender (#2535) 2021-01-15 20:33:29 -05:00
unit Add @inheritDoc to all setUp and tearDown methods 2021-01-09 00:35:55 -05:00
phpunit.integration.xml Use process isolation for integration tests 2020-12-01 19:33:24 -05:00
phpunit.unit.xml Automatically set up Mockery for unit tests 2019-11-21 00:51:11 +01:00