for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Doctrine\Tests\ORM\Functional\SchemaTool;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Annotation as ORM;
use Doctrine\Tests\OrmFunctionalTestCase;
class SqliteSchemaToolTest extends OrmFunctionalTestCase
{
public function testForeignKeysIsNotCompared(): void
if ($this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
$this->markTestSkipped('Test for platforms without foreign keys support');
}
$class = $this->em->getClassMetadata(SqliteSchemaToolChild::class);
$this->schemaTool->updateSchema([$class]);
$diff = $this->schemaTool->getUpdateSchemaSql([$class]);
self::assertEmpty($diff);
/**
* @ORM\Entity
*/
class SqliteSchemaToolParent
/** @ORM\Id @ORM\Column(type="integer") @ORM\GeneratedValue */
public $id;
/** @ORM\OneToMany(targetEntity=SqliteSchemaToolChild::class, mappedBy="parent") */
public $children;
public function __construct()
$this->children = new ArrayCollection();
class SqliteSchemaToolChild
/** @ORM\ManyToOne(targetEntity=SqliteSchemaToolParent::class) */
public $parent;