updateApp example

$app = $this->loadAppByName($manifest->getMetadata()->getName()$context);
        if ($app) {
            throw AppException::alreadyInstalled($manifest->getMetadata()->getName());
        }

        $defaultLocale = $this->getDefaultLocale($context);
        $metadata = $manifest->getMetadata()->toArray($defaultLocale);
        $appId = Uuid::randomHex();
        $roleId = Uuid::randomHex();
        $metadata = $this->enrichInstallMetadata($manifest$metadata$roleId);

        $app = $this->updateApp($manifest$metadata$appId$roleId$defaultLocale$context, true);

        $event = new AppInstalledEvent($app$manifest$context);
        $this->eventDispatcher->dispatch($event);
        $this->scriptExecutor->execute(new AppInstalledHook($event));

        if ($activate) {
            $this->appStateService->activateApp($appId$context);
        }

        $this->updateAclRole($app->getName()$context);
    }

    
$customEntitySchemaUpdater,
            $customEntityEnrichmentService,
            $customEntityXmlSchemaValidator,
            '',
            $this->createAppLoader(),
        );

        static::assertNull(
            $customEntityLifecycleService->updatePlugin(Uuid::randomHex(), 'not/given')
        );
        static::assertNull(
            $customEntityLifecycleService->updateApp(Uuid::randomHex(), 'not/given')
        );
    }

    public function testUpdatePluginOnlyCustomEntities(): void
    {
        $customEntityPersister = $this->createMock(CustomEntityPersister::class);
        $customEntityPersister->expects(static::once())->method('update');

        $customEntitySchemaUpdater = $this->createMock(CustomEntitySchemaUpdater::class);
        $customEntitySchemaUpdater->expects(static::once())->method('update');

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