Code Duplication    Length = 15-20 lines in 3 locations

src/Kunstmaan/MultiDomainBundle/Tests/unit/Helper/DomainConfigurationTest.php 1 location

@@ 277-296 (lines=20) @@
274
        $this->assertEquals(array('en'), $object->getBackendLocales());
275
    }
276
277
    private function getContainer($map, $request)
278
    {
279
        $container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface');
280
281
        $container
282
            ->method('getParameter')
283
            ->willReturnMap($map);
284
285
        $serviceMap = array(
286
            array('request_stack', 1, $this->getRequestStack($request)),
287
            array('doctrine.orm.entity_manager', 1, $this->getEntityManager()),
288
            array('kunstmaan_admin.adminroute.helper', 1, $this->getAdminRouteHelper()),
289
        );
290
291
        $container
292
            ->method('get')
293
            ->willReturnMap($serviceMap);
294
295
        return $container;
296
    }
297
298
    private function getEntityManager()
299
    {

src/Kunstmaan/MultiDomainBundle/Tests/unit/Router/DomainBasedLocaleRouterTest.php 1 location

@@ 186-201 (lines=16) @@
183
     *
184
     * @return Container
185
     */
186
    private function getContainer($request, $nodeTranslation = null)
187
    {
188
        $container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface');
189
        $serviceMap = array(
190
            array('request_stack', 1, $this->getRequestStack($request)),
191
            array('kunstmaan_admin.domain_configuration', 1, $this->getDomainConfiguration()),
192
            array('doctrine.orm.entity_manager', 1, $this->getEntityManager($nodeTranslation)),
193
        );
194
195
        $container
196
            ->method('get')
197
            ->willReturnMap($serviceMap);
198
199
        /* @var Container $container */
200
        return $container;
201
    }
202
203
    private function getRequestStack($request)
204
    {

src/Kunstmaan/NodeBundle/Tests/unit/Router/SlugRouterTest.php 1 location

@@ 68-82 (lines=15) @@
65
        $object->match('/en/some-uri');
66
    }
67
68
    private function getContainer($request, $multiLanguage = false, $nodeTranslation = null)
69
    {
70
        $container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface');
71
        $serviceMap = array(
72
            array('request_stack', 1, $this->getRequestStack($request)),
73
            array('kunstmaan_admin.domain_configuration', 1, $this->getDomainConfiguration($multiLanguage)),
74
            array('doctrine.orm.entity_manager', 1, $this->getEntityManager($nodeTranslation)),
75
        );
76
77
        $container
78
            ->method('get')
79
            ->willReturnMap($serviceMap);
80
81
        return $container;
82
    }
83
84
    private function getRequestStack($request)
85
    {