createCountry example


        $hasData = $connection->executeQuery('SELECT 1 FROM `language` LIMIT 1')->fetchAssociative();
        if ($hasData) {
            return;
        }

        $this->createLanguage($connection);
        $this->createLocale($connection);

        $this->createDocumentTypes($connection);
        $this->createSalutation($connection);
        $this->createCountry($connection);
        $this->createCurrency($connection);
        $this->createCustomerGroup($connection);
        $this->createPaymentMethod($connection);
        $this->createShippingMethod($connection);
        $this->createTax($connection);
        $this->createRootCategory($connection);
        $this->createSalesChannelTypes($connection);
        $this->createSalesChannel($connection);
        $this->createProductManufacturer($connection);
        $this->createDefaultSnippetSets($connection);
        $this->createDefaultMediaFolders($connection);
        
protected function setUp(): void
    {
        $this->countryRepository = $this->getContainer()->get('country.repository');
        $serializerRegistry = $this->getContainer()->get(SerializerRegistry::class);

        $this->serializer = new CountrySerializer($this->countryRepository);
        $this->serializer->setRegistry($serializerRegistry);
    }

    public function testSimple(): void
    {
        $this->createCountry();

        $config = new Config([][][]);
        $country = [
            'iso' => 'XX',
        ];

        $serialized = iterator_to_array($this->serializer->serialize($config$this->countryRepository->getDefinition()$country));

        $deserialized = iterator_to_array($this->serializer->deserialize($config$this->countryRepository->getDefinition()$serialized));

        static::assertSame($this->countryId, $deserialized['id']);
    }
protected function setUp(): void
    {
        $this->languageRepository = $this->getContainer()->get('language.repository');
        $serializerRegistry = $this->getContainer()->get(SerializerRegistry::class);

        $this->serializer = new LanguageSerializer($this->languageRepository);
        $this->serializer->setRegistry($serializerRegistry);
    }

    public function testSimple(): void
    {
        $this->createCountry();

        $config = new Config([][][]);
        $language = [
            'locale' => [
                'code' => 'xx-XX',
            ],
        ];

        $serialized = iterator_to_array($this->serializer->serialize($config$this->languageRepository->getDefinition()$language));

        $deserialized = iterator_to_array($this->serializer->deserialize($config$this->languageRepository->getDefinition()$serialized));

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