AppPayloadServiceHelper example

->willReturn(new TaxProviderDefinition());

        $shopIdProvider = static::createMock(ShopIdProvider::class);
        $shopIdProvider
            ->method('getShopId')
            ->willReturn($this->ids->get('shop-id'));

        $entityEncoder = new JsonEntityEncoder(
            new Serializer([new StructNormalizer()][new JsonEncoder()])
        );

        $appPayloadServiceHelper = new AppPayloadServiceHelper(
            $definitionInstanceRegistry,
            $entityEncoder,
            $shopIdProvider
        );

        $url = 'https://example.com/provide-tax';
        $context = new Context(new SystemSource());
        $responseContent = \json_encode([
            'lineItemTaxes' => [
                $this->ids->get('line-item-1') => [
                    [
                        

        $this->ids = new IdsCollection();
    }

    public function testBuildSource(): void
    {
        $shopIdProvider = static::createMock(ShopIdProvider::class);
        $shopIdProvider
            ->method('getShopId')
            ->willReturn($this->ids->get('shop-id'));

        $appPayloadServiceHelper = new AppPayloadServiceHelper(
            static::createMock(DefinitionInstanceRegistry::class),
            static::createMock(JsonEntityEncoder::class),
            $shopIdProvider
        );

        $app = new AppEntity();
        $app->setVersion('1.0.0');

        $source = $appPayloadServiceHelper->buildSource($app, 'https://shopware.com');

        static::assertInstanceOf(Source::class$source);

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