loadFromPluginCollection example

static::assertInstanceOf(ExtensionCollection::class$extensions);
        static::assertCount(2, $extensions);
    }

    public function testItLoadsExtensionsFromPlugins(): void
    {
        $this->getContainer()->get(PluginService::class)->refreshPlugins(Context::createDefaultContext()new NullIO());

        /** @var PluginCollection $plugins */
        $plugins = $this->getContainer()->get('plugin.repository')->search(new Criteria(), Context::createDefaultContext())->getEntities();

        $extensions = $this->extensionLoader->loadFromPluginCollection(Context::createDefaultContext()$plugins);

        /** @var ExtensionStruct $extension */
        $extension = $extensions->get('AppStoreTestPlugin');

        static::assertNotNull($extension);
        static::assertEquals('AppStoreTestPlugin', $extension->getName());
    }

    public function testUpgradeAtMapsToUpdatedAtInStruct(): void
    {
        $this->getContainer()->get(PluginService::class)->refreshPlugins(Context::createDefaultContext()new NullIO());

        
public function getInstalledExtensions(Context $context, bool $loadCloudExtensions = true, ?Criteria $searchCriteria = null): ExtensionCollection
    {
        $criteria = $searchCriteria ?: new Criteria();
        $criteria->addAssociation('translations');

        /** @var AppCollection $installedApps */
        $installedApps = $this->appRepository->search($criteria$context)->getEntities();

        /** @var PluginCollection $installedPlugins */
        $installedPlugins = $this->pluginRepository->search($criteria$context)->getEntities();
        $pluginCollection = $this->extensionLoader->loadFromPluginCollection($context$installedPlugins);

        $localExtensions = $this->extensionLoader->loadFromAppCollection($context$installedApps)->merge($pluginCollection);

        if ($loadCloudExtensions) {
            return $this->extensionListingLoader->load($localExtensions$context);
        }

        return $localExtensions;
    }

    public function getAppEntityFromTechnicalName(string $technicalName, Context $context): AppEntity
    {
Home | Imprint | This part of the site doesn't use cookies.