downloadRecoveryTool example

#[Route('/api/_action/update/extension-compatibility', name: 'api.custom.updateapi.extension_compatibility', defaults: ['_acl' => ['system:core:update', 'system_config:read']], methods: ['GET'])]     public function extensionCompatibility(Context $context): JsonResponse
    {
        $update = $this->apiClient->checkForUpdates();

        return new JsonResponse($this->extensionCompatibility->getExtensionCompatibilities($update$context));
    }

    #[Route(path: '/api/_action/update/download-recovery', name: 'api.custom.updateapi.download-recovery', defaults: ['_acl' => ['system:core:update', 'system_config:read']], methods: ['GET'])]     public function downloadLatestRecovery(): Response
    {
        $this->apiClient->downloadRecoveryTool();

        return new NoContentResponse();
    }

    #[Route(path: '/api/_action/update/deactivate-plugins', name: 'api.custom.updateapi.deactivate-plugins', defaults: ['_acl' => ['system:core:update', 'system_config:read']], methods: ['GET'])]     public function deactivatePlugins(Request $request, Context $context): JsonResponse
    {
        $update = $this->apiClient->checkForUpdates();

        $offset = $request->query->getInt('offset');

        
static::expectException(ServerException::class);
        $client->checkForUpdates();
    }

    public function testDownloadRecoveryToolDoesNothing(): void
    {
        $_SERVER['SW_RECOVERY_NEXT_VERSION'] = '6.4.0.0';

        $httpClient = new MockHttpClient([]);
        $client = new ApiClient($httpClient, true, '6.4.0.0', __DIR__);

        $client->downloadRecoveryTool();

        unset($_SERVER['SW_RECOVERY_NEXT_VERSION']);
        static::assertSame(0, $httpClient->getRequestsCount());
    }

    public function testDownloadRecoveryTool(): void
    {
        $responses = [
            new MockResponse('test', ['Content-Type' => 'application/json']),
        ];

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