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

DDC3303Test   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 5
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createSchema() 0 4 1
A testEmbeddedObjectsAreAlsoInherited() 0 14 1
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