diff --git a/tests/integration/DoctrineUuidTest.php b/tests/integration/DoctrineUuidTest.php new file mode 100644 index 0000000..20b8daf --- /dev/null +++ b/tests/integration/DoctrineUuidTest.php @@ -0,0 +1,54 @@ +getEntityManager(); + + $shop = $this->createShop(); + $config = (new ConfigEntity()) + ->setShop($shop); + + $em->persist($config); + $em->flush(); + + static::assertNotNull($config->getId()); + $id = (string) $config->getId(); + + $em->persist($config); + $em->flush(); + + static::assertSame($id, (string) $config->getId()); + } + + public function testWithRef(): void + { + $em = $this->getEntityManager(); + + $shop = $this->createShop(); + $config = (new ConfigEntity()) + ->setShop($shop); + + $em->persist($config); + $em->flush(); + + static::assertNotNull($config->getId()); + $id = (string) $config->getId(); + + $configRef = $em->getReference(ConfigEntity::class, $id); + $configRef->setThreeDSecureEnforced(true); + + $em->persist($configRef); + $em->flush(); + + $config = $em->find(ConfigEntity::class, $id); + + static::assertSame($id, (string) $config->getId()); + static::assertTrue($config->isThreeDSecureEnforced()); + } +}