DoctrineOrmExtension example



        try {
            $schemaTool->createSchema($classes);
        } catch (\Exception $e) {
        }
    }

    protected function getExtensions()
    {
        return array_merge(parent::getExtensions()[
            new DoctrineOrmExtension($this->emRegistry),
        ]);
    }

    protected function persist(array $entities)
    {
        foreach ($entities as $entity) {
            $this->em->persist($entity);
        }

        $this->em->flush();
        // no clear, because entities managed by the choice field must
$manager->expects($this->any())
            ->method('getManager')
            ->willReturn($this->em);

        $manager->expects($this->any())
            ->method('getManagerForClass')
            ->willReturn($this->em);

        return [
            new CoreExtension(),
            new DoctrineOrmExtension($manager),
        ];
    }

    protected function setUp(): void
    {
        $this->em = DoctrineTestHelper::createTestEntityManager();

        parent::setUp();

        $schemaTool = new SchemaTool($this->em);
        $classes = [
            
Home | Imprint | This part of the site doesn't use cookies.