getCmsExtensions example

$this->updateModules($manifest$id$defaultLocale$context);
        }

        $this->ruleConditionPersister->updateConditions($manifest$id$defaultLocale$context);
        $this->actionButtonPersister->updateActions($manifest$id$defaultLocale$context);
        $this->templatePersister->updateTemplates($manifest$id$context);
        $this->scriptPersister->updateScripts($id$context);
        $this->customFieldPersister->updateCustomFields($manifest$id$context);
        $this->assetService->copyAssetsFromApp($app->getName()$app->getPath());

        $cmsExtensions = $this->appLoader->getCmsExtensions($app);
        if ($cmsExtensions) {
            $this->cmsBlockPersister->updateCmsBlocks($cmsExtensions$id$defaultLocale$context);
        }

        $updatePayload = [
            'id' => $app->getId(),
            'configurable' => $this->handleConfigUpdates($app$manifest$install$context),
            'allowDisable' => $this->doesAllowDisabling($app$context),
        ];
        $this->updateMetadata($updatePayload$context);

        
public function testGetCMSNotExistent(): void
    {
        $appLoader = new AppLoader(
            __DIR__,
            __DIR__,
            new ConfigReader()
        );

        $appEntity = new AppEntity();
        $appEntity->setPath('non-existing');

        static::assertNull($appLoader->getCmsExtensions($appEntity));
    }

    public function testGetCMS(): void
    {
        $appLoader = new AppLoader(
            __DIR__,
            __DIR__,
            new ConfigReader()
        );

        $appEntity = new AppEntity();
        

        static::assertEquals($expectedConfig$appLoader->getConfiguration($app));
    }

    public function testGetCmsExtensions(): void
    {
        $appLoader = $this->getAppLoader(__DIR__ . '/../Manifest/_fixtures/test');

        $path = str_replace($this->getContainer()->getParameter('kernel.project_dir') . '/', '', __DIR__ . '/../Manifest/_fixtures/test');
        $app = (new AppEntity())->assign(['path' => $path]);

        $cmsManifest = $appLoader->getCmsExtensions($app);
        static::assertInstanceOf(CmsManifest::class$cmsManifest);

        $blocks = $cmsManifest->getBlocks();
        static::assertNotNull($blocks);
        static::assertCount(2, $blocks->getBlocks());
    }
}
Home | Imprint | This part of the site doesn't use cookies.