UninstallAppsStrategy example

$themeLifecycleHandler = null;
        if (class_exists(ThemeAppLifecycleHandler::class)) {
            $themeLifecycleHandler = $this->createMock(ThemeAppLifecycleHandler::class);
            $themeLifecycleHandler->expects(static::once())
                ->method('handleUninstall')
                ->with(
                    static::callback(fn (AppDeactivatedEvent $event) => $event->getApp()->getName() === $app->getName())
                );
        }

        $uninstallAppsResolver = new UninstallAppsStrategy(
            $this->getContainer()->get('app.repository'),
            $this->systemConfigService,
            $themeLifecycleHandler
        );

        $uninstallAppsResolver->resolve($this->context);

        static::assertNotEquals($shopId$this->shopIdProvider->getShopId());

        static::assertNull($this->getInstalledApp($this->context));
    }

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