Completed
Push — 2.6 ( fe72b0...4b0d86 )
by Luís
31s queued 21s
created

GH7841Parent   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
dl 0
loc 11
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\ORM\Functional\Ticket;
6
7
use Doctrine\Common\Collections\ArrayCollection;
8
use Doctrine\Tests\OrmFunctionalTestCase;
9
10
/**
11
 * @group GH7841
12
 */
13
class GH7841Test extends OrmFunctionalTestCase
14
{
15
    public function testForeignKeysNotCompare() : void
16
    {
17
        if ($this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
18
            $this->markTestSkipped('Test for platforms without foreign keys support');
19
        }
20
        $class = $this->_em->getClassMetadata(GH7841Child::class);
21
        $this->_schemaTool->updateSchema([$class], true);
22
        $diff = $this->_schemaTool->getUpdateSchemaSql([$class], true);
23
24
        self::assertEmpty($diff);
25
26
        $this->_schemaTool->dropSchema([$class]);
27
    }
28
}
29
30
/**
31
 * @Entity
32
 */
33
class GH7841Parent
34
{
35
    /** @Id @Column(type="integer") @GeneratedValue */
36
    public $id;
37
38
    /** @OneToMany(targetEntity=GH7841Child::class, mappedBy="parent") */
39
    public $children;
40
41
    public function __construct()
42
    {
43
        $this->children = new ArrayCollection();
44
    }
45
}
46
47
/**
48
 * @Entity
49
 */
50
class GH7841Child
51
{
52
    /** @Id @Column(type="integer") @GeneratedValue */
53
    public $id;
54
55
    /** @ManyToOne(targetEntity=GH7841Parent::class) */
56
    public $parent;
57
}
58