PluginExtractor example

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')
        );
    }

    private function getPluginService(): PluginService
    {
/** * @var Filesystem */
    private $filesystem;

    private PluginExtractor $extractor;

    protected function setUp(): void
    {
        $this->container = $this->getContainer();
        $this->filesystem = $this->container->get(Filesystem::class);
        $this->extractor = new PluginExtractor(['plugin' => __DIR__ . '/_fixture/plugins']$this->filesystem);

        $this->filesystem->copy(__DIR__ . '/_fixture/archives/SwagFashionTheme.zip', __DIR__ . '/_fixture/SwagFashionTheme.zip');
    }

    protected function tearDown(): void
    {
        $this->filesystem->remove(__DIR__ . '/_fixture/plugins/SwagFashionTheme');
    }

    public function testExtractPlugin(): void
    {
        
Home | Imprint | This part of the site doesn't use cookies.