Code Duplication    Length = 24-24 lines in 2 locations

src/Bundle/TranslationBundle/Tests/EventSubscriber/TranslatableResourceSubscriberTest.php 1 location

@@ 52-75 (lines=24) @@
49
    /**
50
     * {@inheritdoc}
51
     */
52
    protected function setUp()
53
    {
54
        $this->container = $this->createContainerMock();
55
        $this->resourceRegistry = $this->createResourceRegistryMock();
56
        $this->localeContext = $this->createLocaleContextMock();
57
58
        $this->container
59
            ->expects($this->any())
60
            ->method('get')
61
            ->will($this->returnValueMap([
62
                [
63
                    'lug.resource.registry',
64
                    ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
65
                    $this->resourceRegistry,
66
                ],
67
                [
68
                    'lug.translation.context.locale',
69
                    ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
70
                    $this->localeContext,
71
                ],
72
            ]));
73
74
        $this->translatableResourceSubscriber = new TranslatableResourceSubscriber($this->container);
75
    }
76
77
    public function testInheritance()
78
    {

src/Component/Translation/Tests/Repository/Doctrine/ORM/TranslatableRepositoryFactoryTest.php 1 location

@@ 55-78 (lines=24) @@
52
    /**
53
     * {@inheritdoc}
54
     */
55
    protected function setUp()
56
    {
57
        $this->resourceRegistry = $this->createServiceRegistryMock();
58
        $this->localeContext = $this->createLocaleContextMock();
59
60
        $this->container = $this->createContainerMock();
61
        $this->container
62
            ->expects($this->atLeast(1))
63
            ->method('get')
64
            ->will($this->returnValueMap([
65
                [
66
                    'lug.resource.registry',
67
                    ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
68
                    $this->resourceRegistry,
69
                ],
70
                [
71
                    'lug.translation.context.locale',
72
                    ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
73
                    $this->localeContext,
74
                ],
75
            ]));
76
77
        $this->repositoryFactory = new TranslatableRepositoryFactory($this->container);
78
    }
79
80
    public function testInheritance()
81
    {