TestExtensionMigration example

$serializer->setRegistry($serializerRegistry);
        $return = $serializer->deserialize(new Config([][][])$productDefinition$importData);
        $return = \is_array($return) ? $return : iterator_to_array($return);

        static::assertSame($expectedData$return);
    }

    public function testEntityExtensionSerialization(): void
    {
        // add temporary db table for the test extension         $connection = $this->getContainer()->get(Connection::class);
        $migration = new TestExtensionMigration();
        $migration->update($connection);
        $connection->setNestTransactionsWithSavepoints(true);
        $connection->beginTransaction(); // do everything in a transaction
        // setup test extension         $this->registerDefinition(TestExtensionDefinition::class);
        $this->registerDefinitionWithExtensions(ProductDefinition::class, TestExtension::class);

        // create a product with extension data         $productRepo = $this->getContainer()->get('product.repository');
        $taxCriteria = new Criteria();
        
Home | Imprint | This part of the site doesn't use cookies.