mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-09 18:24:26 +02:00
Addon::initAddon() should call bootstrap only once
This commit is contained in:
parent
b47fc318a5
commit
a85343dbed
2 changed files with 21 additions and 0 deletions
|
@ -67,6 +67,19 @@ class AddonProxyTest extends TestCase
|
|||
$addon->initAddon([]);
|
||||
}
|
||||
|
||||
public function testInitAddonMultipleTimesWillCallBootstrapOnce(): void
|
||||
{
|
||||
$bootstrap = $this->createMock(AddonBootstrap::class);
|
||||
$bootstrap->expects($this->once())->method('initAddon')->willReturnCallback(function ($event) {
|
||||
$this->assertInstanceOf(AddonStartEvent::class, $event);
|
||||
});
|
||||
|
||||
$addon = new AddonProxy($bootstrap);
|
||||
|
||||
$addon->initAddon([]);
|
||||
$addon->initAddon([]);
|
||||
}
|
||||
|
||||
public function testInitAddonCallsBootstrapWithDependencies(): void
|
||||
{
|
||||
$bootstrap = $this->createMock(AddonBootstrap::class);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue