HandshakeFactory example

class HandshakeFactoryTest extends TestCase
{
    use AppSystemTestBehaviour;
    use IntegrationTestBehaviour;

    public function testManifestWithSecretProducesAPrivateHandshake(): void
    {
        $manifest = Manifest::createFromXmlFile(__DIR__ . '/../../Manifest/_fixtures/minimal/manifest.xml');

        $shopUrl = 'test.shop.com';

        $factory = new HandshakeFactory(
            $shopUrl,
            $this->getContainer()->get(ShopIdProvider::class),
            $this->getContainer()->get(StoreClient::class),
            Kernel::SHOPWARE_FALLBACK_VERSION
        );

        $handshake = $factory->create($manifest);

        static::assertInstanceOf(PrivateHandshake::class$handshake);
    }

    
$systemConfigService = $this->getContainer()->get(SystemConfigService::class);
        $systemConfigService->set(ShopIdProvider::SHOP_ID_SYSTEM_CONFIG_KEY, [
            'app_url' => 'https://test.com',
            'value' => $shopId,
        ]);

        $shopIdProviderMock = $this->createMock(ShopIdProvider::class);
        $shopIdProviderMock->expects(static::once())
            ->method('getShopId')
            ->willReturn($shopId);

        $handshakeFactory = new HandshakeFactory(
            $this->shopUrl,
            $shopIdProviderMock,
            $this->getContainer()->get(StoreClient::class),
            Kernel::SHOPWARE_FALLBACK_VERSION
        );

        $registrator = new AppRegistrationService(
            $handshakeFactory,
            $this->getContainer()->get('shopware.app_system.guzzle'),
            $this->getContainer()->get('app.repository'),
            $this->shopUrl,
            
Home | Imprint | This part of the site doesn't use cookies.