Completed
Pull Request — 2.6 (#7857)
by
unknown
07:02
created

GH7854Test::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\ORM\Functional\Ticket;
6
7
use Doctrine\Tests\OrmFunctionalTestCase;
8
9
/**
10
 * @group GH7854
11
 * @requires PHP >= 7.4
12
 */
13
class GH7854Test extends OrmFunctionalTestCase
14
{
15
    public function setUp()
16
    {
17
        parent::setUp();
18
19
        $this->_schemaTool->createSchema(
20
            [
21
                $this->_em->getClassMetadata(GH7854Entity::class),
22
                $this->_em->getClassMetadata(GH7854ValueObject::class),
23
            ]
24
        );
25
    }
26
27
    public function testTypedPropertyContainingEmbeddable() : void
28
    {
29
        $this->_em->persist(new GH7854Entity());
30
        $this->_em->flush();
31
        $this->_em->getRepository(GH7854Entity::class)->findAll();
32
    }
33
}
34
35
/**
36
 * @Entity()
37
 */
38
class GH7854Entity
39
{
40
    /**
41
     * @Embedded(class=GH7854ValueObject::class)
42
     */
43
    private GH7854ValueObject $valueObject;
0 ignored issues
show
introduced by
The private property $valueObject is not used, and could be removed.
Loading history...
44
}
45
46
/**
47
 * @Embeddable()
48
 */
49
class GH7854ValueObject
50
{
51
    /** @Id() @Column(type="integer") @GeneratedValue(strategy="AUTO") */
52
    private int $value;
0 ignored issues
show
introduced by
The private property $value is not used, and could be removed.
Loading history...
53
}
54