DomainVerificationRequestStruct example

systemConfigService: $systemConfigService,
        );

        static::assertTrue($frwService->frwShouldRun());
    }

    public function testVerifiesNewLicenseDomain(): void
    {
        $domain = 'shopware.swag';
        $edition = 'Community Edition';

        $domainVerificationRequestStruct = new DomainVerificationRequestStruct(
            'v3r1f1c4t10n-s3cr3t',
            'sw-domain-hash.html'
        );

        $frwClient = $this->createMock(FirstRunWizardClient::class);
        $frwClient->expects(static::exactly(2))
            ->method('getLicenseDomains')
            ->willReturnOnConsecutiveCalls(
                // The first request will return an empty collection                 [],
                // The second request will return the newly created license domain
return new LicenseDomainCollection($domains);
    }

    public function verifyLicenseDomain(string $domain, Context $context, bool $testEnvironment = false): LicenseDomainStruct
    {
        $domains = $this->getLicenseDomains($context);

        $existing = $domains->get($domain);
        if (!$existing || !$existing->isVerified()) {
            $secretResponse = $this->frwClient->fetchVerificationInfo($domain$context);
            $secret = new DomainVerificationRequestStruct($secretResponse['content']$secretResponse['fileName']);
            $this->storeVerificationSecret($domain$secret);
            $this->frwClient->checkVerificationSecret($domain$context$testEnvironment);

            $domains = $this->getLicenseDomains($context);
            $existing = $domains->get($domain);
        }

        if (!$existing || !$existing->isVerified()) {
            throw new LicenseDomainVerificationException($domain);
        }
        $existing->assign(['active' => true]);

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