PluginManagementService example

return $cacheDir;
    }

    private function createUploadedFile(): UploadedFile
    {
        return new UploadedFile(self::PLUGIN_ZIP_FIXTURE_PATH, self::TEST_PLUGIN_ZIP_NAME, null, null, true);
    }

    private function getPluginManagementService(): PluginManagementService
    {
        return new PluginManagementService(
            self::PLUGINS_PATH,
            new PluginZipDetector(),
            new PluginExtractor([
                'plugin' => self::PLUGINS_PATH,
                'app' => self::APPS_PATH,
            ]$this->filesystem),
            $this->getPluginService(),
            $this->filesystem,
            $this->getCacheClearer(),
            $this->getContainer()->get('shopware.store_download_client')
        );
    }
public function testRefreshesPluginsAfterDownloadingFromStore(): void
    {
        $client = $this->createClient([new Response()]);

        $pluginService = $this->createMock(PluginService::class);
        $pluginService->expects(static::once())->method('refreshPlugins');

        $extractor = $this->createMock(PluginExtractor::class);
        $extractor->expects(static::once())
            ->method('extract');

        $pluginManagementService = new PluginManagementService(
            '',
            $this->createMock(PluginZipDetector::class),
            $extractor,
            $pluginService,
            $this->createMock(Filesystem::class),
            $this->createMock(CacheClearer::class),
            $client
        );

        $pluginManagementService->downloadStorePlugin(
            $this->createPluginDownloadDataStruct('location', 'plugin'),
            
Home | Imprint | This part of the site doesn't use cookies.