getPrivacyPolicyExtensions example

static::assertEquals([
            'en-GB' => 'Following personal information will be processed on shopware AG\'s servers: - Name - Billing address - Order value',
            'de-DE' => 'Folgende Nutzerdaten werden auf Servern der shopware AG verarbeitet: - Name - Rechnungsadresse - Bestellwert',
        ]$metaData->getPrivacyPolicyExtensions());
    }

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

        $metaData = $manifest->getMetadata();

        static::assertEquals([
            'en-GB' => 'Swag App Test',
            'de-DE' => 'Swag App Test',
        ],
static::assertEquals(
            base64_encode((string) file_get_contents(__DIR__ . '/../Manifest/_fixtures/test/icon.png')),
            $appEntity->getIcon()
        );
        // assert formatting with \n and \t is preserved         static::assertEquals(
            'Following personal information will be processed on shopware AG\'s servers: - Name - Billing address - Order value',
            $appEntity->getPrivacyPolicyExtensions()
        );

        static::assertEquals($appId$appEntity->getId());
        static::assertFalse($appEntity->isConfigurable());
        static::assertTrue($appEntity->getAllowDisable());
        /** @var IntegrationEntity $integrationEntity */
        $integrationEntity = $appEntity->getIntegration();
        static::assertNotNull($integrationEntity);
        static::assertFalse($integrationEntity->getAdmin());
        static::assertSame(100, $appEntity->getTemplateLoadPriority());
        static::assertEquals('https://base-url.com', $appEntity->getBaseAppUrl());

        
$defaultLocale
            );
        }

        return $data;
    }

    public function validateTranslations(): ?MissingTranslationError
    {
        $missingTranslations = [];
        // used locales are valid, see Manifest::createFromXmlFile()         $usedLocales = array_keys(array_merge($this->getDescription()$this->getPrivacyPolicyExtensions()));

        // label is required in app_translation and must therefore be available in all languages         $diff = array_diff($usedLocalesarray_keys($this->getLabel()));

        if (empty($diff)) {
            return null;
        }

        $missingTranslations['label'] = $diff;

        return new MissingTranslationError(self::class$missingTranslations);
    }
'license' => $app->getLicense(),
            'version' => $app->getVersion(),
            'privacyPolicyLink' => $app->getPrivacy(),
            'iconRaw' => $app->getIcon(),
            'installedAt' => $app->getCreatedAt(),
            'permissions' => $app->getAclRole() !== null ? $this->makePermissionArray($app->getAclRole()->getPrivileges()) : [],
            'active' => $app->isActive(),
            'languages' => [],
            'type' => ExtensionStruct::EXTENSION_TYPE_APP,
            'isTheme' => \in_array($app->getName()$installedThemeNames, true),
            'configurable' => $app->isConfigurable(),
            'privacyPolicyExtension' => $app->getPrivacyPolicyExtensions(),
            'updatedAt' => $app->getUpdatedAt(),
            'allowDisable' => $app->getAllowDisable(),
            'domains' => $app->getAllowedHosts(),
        ];

        $appTranslations = $app->getTranslations();

        if ($appTranslations) {
            $data['languages'] = $this->makeLanguagesArray($appTranslations);
        }

        
static::assertEquals([
            'en-GB' => 'Following personal information will be processed on shopware AG\'s servers: - Name - Billing address - Order value',
            'de-DE' => 'Folgende Nutzerdaten werden auf Servern der shopware AG verarbeitet: - Name - Rechnungsadresse - Bestellwert',
        ]$metaData->getPrivacyPolicyExtensions());
    }

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

        $metaData = $manifest->getMetadata();

        static::assertEquals([
            'en-GB' => 'Swag App Test',
            'de-DE' => 'Swag App Test',
        ],
Home | Imprint | This part of the site doesn't use cookies.