Failed Conditions
Pull Request — master (#7842)
by
unknown
09:15
created

testForeignKeysIsNotCompared()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 10
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\ORM\Functional\SchemaTool;
6
7
use Doctrine\Common\Collections\ArrayCollection;
8
use Doctrine\ORM\Annotation as ORM;
9
use Doctrine\Tests\OrmFunctionalTestCase;
10
11
class SqliteSchemaToolTest extends OrmFunctionalTestCase
12
{
13
    public function testForeignKeysIsNotCompared(): void
0 ignored issues
show
introduced by
There must be exactly 1 whitespace between closing parenthesis and return type colon.
Loading history...
14
    {
15
        if ($this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
16
            $this->markTestSkipped('Test for platforms without foreign keys support');
17
        }
18
        $class = $this->em->getClassMetadata(SqliteSchemaToolChild::class);
19
        $this->schemaTool->updateSchema([$class]);
20
        $diff = $this->schemaTool->getUpdateSchemaSql([$class]);
21
22
        self::assertEmpty($diff);
23
    }
24
}
25
26
/**
27
 * @ORM\Entity
28
 */
29
class SqliteSchemaToolParent
30
{
31
    /** @ORM\Id @ORM\Column(type="integer") @ORM\GeneratedValue */
32
    public $id;
33
34
    /** @ORM\OneToMany(targetEntity=SqliteSchemaToolChild::class, mappedBy="parent") */
35
    public $children;
36
37
    public function __construct()
38
    {
39
        $this->children = new ArrayCollection();
40
    }
41
}
42
43
/**
44
 * @ORM\Entity
45
 */
46
class SqliteSchemaToolChild
47
{
48
    /** @ORM\Id @ORM\Column(type="integer") @ORM\GeneratedValue */
49
    public $id;
50
51
    /** @ORM\ManyToOne(targetEntity=SqliteSchemaToolParent::class) */
52
    public $parent;
53
}
54