$this->connection->executeStatement('DROP TABLE `many_to_one_product`'); $this->connection->executeStatement('DROP TABLE `product_one_to_one_inherited`'); $this->connection->executeStatement('
ALTER TABLE `product`
DROP COLUMN `linked_product_id`,
DROP COLUMN `linked_product_version_id`,
DROP COLUMN `many_to_one_id`,
DROP COLUMN `oneToOneInherited`;
'); $this->connection->beginTransaction();
$this->connection->rollBack(); $this->connection->executeStatement('
ALTER TABLE `product`
DROP FOREIGN KEY `fk.product.many_to_one_id`;
'); $this->connection->executeStatement('DROP TABLE `many_to_one_product`'); $this->connection->executeStatement('
ALTER TABLE `product`
DROP COLUMN `many_to_one_id`
'); $this->connection->beginTransaction(); $this->removeExtension(ToOneProductExtension::class); // reboot kernel to create a new container since we manipulated the original one
KernelLifecycleManager::bootKernel(); }
// teardown test extension (definition can't be removed from the definitionRegistry, but shouldn't cause problems)
$this->removeExtension(TestExtension::class); $this->getContainer()->set(TestExtension::class, null);
// cleanup test extension db table
$connection->rollBack(); // rollback the transaction
$migration->updateDestructive($connection); // remove the extension db table
// check if the serialization works
static::assertArrayHasKey('testExtension', $return); $testExtension = $return['testExtension']; static::assertIsArray($testExtension); static::assertSame($productId, $testExtension['productId']);