Failed Conditions
Push — develop ( ba9041...24f682 )
by Guilherme
64:30
created

DDC3103Test   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 4
dl 0
loc 31
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B testIssue() 0 25 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\ORM\Functional\Ticket;
6
7
use Doctrine\ORM\Annotation as ORM;
8
use Doctrine\ORM\Mapping\ClassMetadata;
9
use Doctrine\ORM\Mapping\ClassMetadataBuildingContext;
10
use Doctrine\ORM\Mapping\ClassMetadataFactory;
11
use Doctrine\ORM\Reflection\ReflectionService;
12
13
/**
14
 * @group DDC-3103
15
 */
16
class DDC3103Test extends \Doctrine\Tests\OrmFunctionalTestCase
17
{
18
    /**
19
     * @covers \Doctrine\ORM\Mapping\ClassMetadata::__sleep
20
     */
21
    public function testIssue()
22
    {
23
        $this->markTestSkipped('Embeddables are ommitted for now');
24
25
        $driver = $this->createAnnotationDriver();
26
27
        $metadataBuildingContext = new ClassMetadataBuildingContext(
28
            $this->createMock(ClassMetadataFactory::class),
29
            $this->createMock(ReflectionService::class)
30
        );
31
32
        $classMetadata = new ClassMetadata(DDC3103ArticleId::class, $metadataBuildingContext);
33
34
        $driver->loadMetadataForClass(DDC3103ArticleId::class, $classMetadata, $metadataBuildingContext);
35
36
        self::assertTrue(
37
            $classMetadata->isEmbeddedClass,
38
            'The isEmbeddedClass property should be true from the mapping data.'
39
        );
40
41
        self::assertTrue(
42
            unserialize(serialize($classMetadata))->isEmbeddedClass,
43
            'The isEmbeddedClass property should still be true after serialization and unserialization.'
44
        );
45
    }
46
}
47
48
/**
49
 * @ORM\Embeddable
50
 */
51
class DDC3103ArticleId
52
{
53
    /**
54
     * @var string
55
     * @ORM\Column(name="name", type="string", length=255)
56
     */
57
    protected $nameValue;
58
}
59