Implement register subscribed events from addons

This commit is contained in:
Art4 2025-01-03 14:04:15 +00:00
parent a85343dbed
commit 57ddf69d1c
6 changed files with 77 additions and 7 deletions

View file

@ -55,6 +55,22 @@ class AddonProxyTest extends TestCase
$addon->getProvidedDependencyRules();
}
public function testGetSubscribedEventsCallsBootstrap(): void
{
$bootstrap = $this->createMock(AddonBootstrap::class);
$bootstrap->expects($this->once())->method('getSubscribedEvents')->willReturn(['foo' => 'bar']);
$addon = new AddonProxy($bootstrap);
$this->assertSame(
[
['foo', [$bootstrap, 'bar']],
],
$addon->getSubscribedEvents()
);
}
public function testInitAddonCallsBootstrap(): void
{
$bootstrap = $this->createMock(AddonBootstrap::class);