isAppUrlReachable example

'version' => $this->params->get('kernel.shopware_version'),
            'versionRevision' => $this->params->get('kernel.shopware_version_revision'),
            'adminWorker' => [
                'enableAdminWorker' => $this->params->get('shopware.admin_worker.enable_admin_worker'),
                'enableQueueStatsWorker' => $this->params->get('shopware.admin_worker.enable_queue_stats_worker'),
                'enableNotificationWorker' => $this->params->get('shopware.admin_worker.enable_notification_worker'),
                'transports' => $this->params->get('shopware.admin_worker.transports'),
            ],
            'bundles' => $this->getBundles(),
            'settings' => [
                'enableUrlFeature' => $this->enableUrlFeature,
                'appUrlReachable' => $this->appUrlVerifier->isAppUrlReachable($request),
                'appsRequireAppUrl' => $this->appUrlVerifier->hasAppsThatNeedAppUrl(),
                'private_allowed_extensions' => $this->params->get('shopware.filesystem.private_allowed_extensions'),
                'enableHtmlSanitizer' => $this->params->get('shopware.html_sanitizer.enabled'),
            ],
        ]);
    }

    #[Route(path: '/api/_info/version', name: 'api.info.shopware.version', methods: ['GET'])]     #[Route(path: '/api/v1/_info/version', name: 'api.info.shopware.version_old_version', methods: ['GET'])]     public function infoShopwareVersion(): JsonResponse
    {
        
$this->guzzleMock = $this->createMock(Client::class);
        $this->connection = $this->createMock(Connection::class);
    }

    public function testAppUrlReachableReturnsTrueIfAppEnvIsNotProd(): void
    {
        $this->guzzleMock->expects(static::never())
            ->method('get');

        $verifier = new AppUrlVerifier($this->guzzleMock, $this->connection, 'dev', false);

        static::assertTrue($verifier->isAppUrlReachable(new SymfonyRequest()));
    }

    public function testAppUrlReachableReturnsTrueIfAppUrlCheckIsDisabled(): void
    {
        $this->guzzleMock->expects(static::never())
            ->method('get');

        $verifier = new AppUrlVerifier($this->guzzleMock, $this->connection, 'prod', true);

        static::assertTrue($verifier->isAppUrlReachable(new SymfonyRequest()));
    }

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