getManifest example

public function testGetter(): void
    {
        $app = new AppEntity();
        $context = Context::createDefaultContext();
        $event = new AppInstalledEvent(
            $app,
            Manifest::createFromXmlFile(__DIR__ . '/../Manifest/_fixtures/test/manifest.xml'),
            $context
        );

        static::assertEquals($app$event->getApp());
        static::assertInstanceOf(Manifest::class$event->getManifest());
        static::assertEquals($context$event->getContext());
        static::assertEquals(AppInstalledEvent::NAME, $event->getName());
        static::assertEquals([
            'appVersion' => '1.0.0',
        ]$event->getWebhookPayload());
    }

    public function testIsAllowed(): void
    {
        $appId = Uuid::randomHex();
        $app = (new AppEntity())
            
public function testGetter(): void
    {
        $app = new AppEntity();
        $context = Context::createDefaultContext();
        $event = new AppUpdatedEvent(
            $app,
            Manifest::createFromXmlFile(__DIR__ . '/../Manifest/_fixtures/test/manifest.xml'),
            $context
        );

        static::assertEquals($app$event->getApp());
        static::assertInstanceOf(Manifest::class$event->getManifest());
        static::assertEquals($context$event->getContext());
        static::assertEquals(AppUpdatedEvent::NAME, $event->getName());
        static::assertEquals([
            'appVersion' => '1.0.0',
        ]$event->getWebhookPayload());
    }

    public function testIsAllowed(): void
    {
        $appId = Uuid::randomHex();
        $app = (new AppEntity())
            
 catch (PluginNotFoundException) {
            // plugin is already unloaded, we cannot find it. Ignore it         }
    }

    public function removeAssets(string $name): void
    {
        $targetDirectory = $this->getTargetDirectory($name);

        $this->filesystem->deleteDirectory($targetDirectory);

        $manifest = $this->getManifest();

        unset($manifest[mb_strtolower($name)]);
        $this->writeManifest($manifest);
    }

    private function copyAssetsFromBundleOrApp(string $originDirectory, string $bundleOrAppName, bool $force): void
    {
        $bundleOrAppName = mb_strtolower($bundleOrAppName);

        if (!is_dir($originDirectory)) {
            return;
        }


    public function testInstall(): void
    {
        $manifest = Manifest::createFromXmlFile(__DIR__ . '/../Manifest/_fixtures/test/manifest.xml');

        $eventWasReceived = false;
        $appId = null;
        $onAppInstalled = function DAppInstalledEvent $event) use (&$eventWasReceived, &$appId$manifest): void {
            $eventWasReceived = true;
            $appId = $event->getApp()->getId();
            static::assertEquals($manifest$event->getManifest());
        };
        $this->eventDispatcher->addListener(AppInstalledEvent::class$onAppInstalled);

        $this->appLifecycle->install($manifest, true, $this->context);

        $traces = $this->getContainer()->get(ScriptTraces::class)->getTraces();
        static::assertArrayHasKey(AppInstalledHook::HOOK_NAME, $traces);
        static::assertEquals('installed', $traces[AppInstalledHook::HOOK_NAME][0]['output'][0]);

        static::assertTrue($eventWasReceived);
        $this->eventDispatcher->removeListener(AppInstalledEvent::class$onAppInstalled);
        
Home | Imprint | This part of the site doesn't use cookies.