Code Duplication    Length = 26-26 lines in 3 locations

bridge/doctrine-phpcr-odm/tests/Functional/CollectionType/ObjectTest.php 1 location

@@ 15-40 (lines=26) @@
12
    private $documentManager;
13
    private $updater;
14
15
    public function setUp()
16
    {
17
        $container = $this->getContainer([
18
            'mapping' => [
19
                Article::class => [
20
                    'fields' => [
21
                        'slideshow' => [
22
                            'type' => 'collection',
23
                            'shared' => [
24
                                'field_type' => 'image',
25
                            ],
26
                        ],
27
                        'objectReferences' => [
28
                            'type' => 'collection',
29
                            'shared' => [
30
                                'field_type' => 'object_reference',
31
                            ],
32
                        ],
33
                    ],
34
                ],
35
            ],
36
        ]);
37
        $this->documentManager = $container->get('doctrine_phpcr.document_manager');
38
        $this->initPhpcr($this->documentManager);
39
        $this->updater = $container->get('psi_content_type.storage.doctrine.phpcr_odm.collection_updater');
40
    }
41
42
    /**
43
     * It should update an object collection.

bridge/doctrine-phpcr-odm/tests/Functional/GeneralTest.php 2 locations

@@ 54-79 (lines=26) @@
51
        $this->initPhpcr($this->documentManager);
52
    }
53
54
    public function initCollectionArticle()
55
    {
56
        $container = $this->getContainer([
57
            'mapping' => [
58
                Article::class => [
59
                    'fields' => [
60
                        'slideshow' => [
61
                            'type' => 'collection',
62
                            'shared' => [
63
                                'field_type' => 'image',
64
                            ],
65
                        ],
66
                        'objectReferences' => [
67
                            'type' => 'collection',
68
                            'shared' => [
69
                                'field_type' => 'object_reference',
70
                            ],
71
                        ],
72
                    ],
73
                ],
74
            ],
75
        ]);
76
        $this->documentManager = $container->get('doctrine_phpcr.document_manager');
77
        $this->initPhpcr($this->documentManager);
78
        $this->updater = $container->get('psi_content_type.storage.doctrine.phpcr_odm.collection_updater');
79
    }
80
81
    public function initScalarCollectionArticle()
82
    {
@@ 81-106 (lines=26) @@
78
        $this->updater = $container->get('psi_content_type.storage.doctrine.phpcr_odm.collection_updater');
79
    }
80
81
    public function initScalarCollectionArticle()
82
    {
83
        $container = $this->getContainer([
84
            'mapping' => [
85
                Article::class => [
86
                    'fields' => [
87
                        'paragraphs' => [
88
                            'type' => 'collection',
89
                            'shared' => [
90
                                'field_type' => 'text',
91
                                'field_options' => [],
92
                            ],
93
                        ],
94
                        'numbers' => [
95
                            'type' => 'collection',
96
                            'shared' => [
97
                                'field_type' => 'integer',
98
                            ],
99
                        ],
100
                    ],
101
                ],
102
            ],
103
        ]);
104
        $this->documentManager = $container->get('doctrine_phpcr.document_manager');
105
        $this->initPhpcr($this->documentManager);
106
    }
107
108
    public function testString()
109
    {