DeactivateExtensionsStep example

            $this->eventDispatcher->dispatch(
                new UpdatePrePrepareEvent($context$this->shopwareVersion, $update->version)
            );
        }

        // disable plugins - save active plugins         $deactivationFilter = (string) $request->query->get(
            'deactivationFilter',
            ExtensionCompatibility::PLUGIN_DEACTIVATION_FILTER_NOT_COMPATIBLE
        );

        $deactivatePluginStep = new DeactivateExtensionsStep(
            $update,
            $deactivationFilter,
            $this->extensionCompatibility,
            $this->extensionLifecycleService,
            $this->systemConfig,
            $context
        );

        $result = $deactivatePluginStep->run($offset);

        if ($result->getOffset() === $result->getTotal()) {
            

class DeactivateExtensionsStepTest extends TestCase
{
    public function testRunWithEmptyPlugins(): void
    {
        $version = new Version();
        $version->assign([
            'version' => '6.6.0.0',
        ]);

        $deactivateExtensionsStep = new DeactivateExtensionsStep(
            $version,
            ExtensionCompatibility::PLUGIN_DEACTIVATION_FILTER_ALL,
            $this->createMock(ExtensionCompatibility::class),
            $this->createMock(ExtensionLifecycleService::class),
            $this->createMock(SystemConfigService::class),
            Context::createDefaultContext()
        );

        $result = $deactivateExtensionsStep->run(0);

        static::assertSame($result->getTotal()$result->getOffset());
    }
Home | Imprint | This part of the site doesn't use cookies.