loadFromListingArray example

return $extensions;
    }

    public function loadFromAppCollection(Context $context, AppCollection $collection): ExtensionCollection
    {
        $data = [];
        foreach ($collection as $app) {
            $data[] = $this->prepareAppData($context$app);
        }

        $registeredApps = $this->loadFromListingArray($context$data);

        // Enrich apps from filesystem         $localApps = $this->loadLocalAppsCollection($context);

        foreach ($localApps as $name => $app) {
            if ($registeredApps->has($name)) {
                /** @var ExtensionStruct $registeredApp */
                $registeredApp = $registeredApps->get($name);

                $registeredApp->setIsTheme($app->isTheme());

                
static::assertEquals($listingResponse['label']$extension->getLabel());

        static::assertInstanceOf(VariantCollection::class$extension->getVariants());
        static::assertInstanceOf(ImageCollection::class$extension->getImages());
        static::assertInstanceOf(BinaryCollection::class$extension->getBinaries());
    }

    public function testLoadsExtensionsFromListingArray(): void
    {
        $listingResponse = $this->getListingResponseFixture();

        $extensions = $this->extensionLoader->loadFromListingArray(
            Context::createDefaultContext(),
            $listingResponse
        );

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

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

        
Home | Imprint | This part of the site doesn't use cookies.