Completed
Pull Request — master (#5867)
by Luís
20:43 queued 06:00
created

DDC3303Test::createSchema()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Doctrine\Tests\ORM\Functional\Ticket;
3
4
use Doctrine\Tests\Models\DDC3303\DDC3303Address;
5
use Doctrine\Tests\Models\DDC3303\DDC3303Employee;
6
use Doctrine\Tests\OrmFunctionalTestCase;
7
8
class DDC3303Test extends OrmFunctionalTestCase
9
{
10
    /**
11
     * @before
12
     */
13
    public function createSchema()
14
    {
15
        $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(DDC3303Employee::class)));
16
    }
17
18
    public function testEmbeddedObjectsAreAlsoInherited()
19
    {
20
        $employee = new DDC3303Employee(
21
            'John Doe',
22
            new DDC3303Address('Somewhere', 123, 'Over the rainbow'),
23
            'Doctrine Inc'
24
        );
25
26
        $this->_em->persist($employee);
27
        $this->_em->flush();
28
        $this->_em->clear();
29
30
        $this->assertEquals($employee, $this->_em->find(DDC3303Employee::class, 1));
31
    }
32
}
33