[]]); $addon = new LegacyAddonProxy('helloaddon', $root->url()); $this->assertInstanceOf(Addon::class, $addon); } public function testGetRequiredDependenciesReturnsEmptyArray(): void { $root = vfsStream::setup('addons', 0777, ['helloaddon' => []]); $addon = new LegacyAddonProxy('helloaddon', $root->url()); $this->assertSame( [], $addon->getRequiredDependencies() ); } public function testGetProvidedDependencyRulesReturnsEmptyArray(): void { $root = vfsStream::setup('addons', 0777, ['helloaddon' => []]); $addon = new LegacyAddonProxy('helloaddon', $root->url()); $this->assertSame( [], $addon->getProvidedDependencyRules() ); } public function testGetSubscribedEventsReturnsEmptyArray(): void { $root = vfsStream::setup('addons', 0777, ['helloaddon' => []]); $addon = new LegacyAddonProxy('helloaddon', $root->url()); $this->assertSame( [], $addon->getSubscribedEvents() ); } public function testInitAddonIncludesAddonFile(): void { $root = vfsStream::setup('addons', 0777, ['helloaddon' => []]); vfsStream::newFile('helloaddon.php') ->at($root->getChild('helloaddon')) ->setContent('url()); try { $addon->initAddon([]); } catch (\Throwable $th) { $this->assertSame( 'Addon loaded', $th->getMessage() ); } } public function testInitAddonMultipleTimesWillIncludeFileOnlyOnce(): void { $root = vfsStream::setup('addons', 0777, ['helloaddon' => []]); vfsStream::newFile('helloaddon.php') ->at($root->getChild('helloaddon')) ->setContent('url()); try { $addon->initAddon([]); } catch (\Throwable $th) { $this->assertSame( 'Addon loaded', $th->getMessage() ); } $addon->initAddon([]); $addon->initAddon([]); } }