Code Duplication    Length = 12-13 lines in 3 locations

Tests/RegistryTest.php 3 locations

@@ 74-86 (lines=13) @@
71
        $this->assertEquals(['default' => 'doctrine.dbal.default_connection'], $registry->getConnectionNames());
72
    }
73
74
    public function testGetDefaultEntityManager()
75
    {
76
        $em        = new stdClass();
77
        $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
78
        $container->expects($this->once())
79
                  ->method('get')
80
                  ->with($this->equalTo('doctrine.orm.default_entity_manager'))
81
                  ->will($this->returnValue($em));
82
83
        $registry = new Registry($container, [], ['default' => 'doctrine.orm.default_entity_manager'], 'default', 'default');
84
85
        $this->assertSame($em, $registry->getManager());
86
    }
87
88
    public function testGetEntityManager()
89
    {
@@ 88-100 (lines=13) @@
85
        $this->assertSame($em, $registry->getManager());
86
    }
87
88
    public function testGetEntityManager()
89
    {
90
        $em        = new stdClass();
91
        $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
92
        $container->expects($this->once())
93
                  ->method('get')
94
                  ->with($this->equalTo('doctrine.orm.default_entity_manager'))
95
                  ->will($this->returnValue($em));
96
97
        $registry = new Registry($container, [], ['default' => 'doctrine.orm.default_entity_manager'], 'default', 'default');
98
99
        $this->assertSame($em, $registry->getManager('default'));
100
    }
101
102
    /**
103
     * @expectedException \InvalidArgumentException
@@ 129-140 (lines=12) @@
126
    /**
127
     * @group legacy
128
     */
129
    public function testReset()
130
    {
131
        $em        = new stdClass();
132
        $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
133
        $container->expects($this->once())
134
            ->method('get')
135
            ->with($this->equalTo('doctrine.orm.default_entity_manager'))
136
            ->will($this->returnValue($em));
137
138
        $registry = new Registry($container, [], ['default' => 'doctrine.orm.default_entity_manager'], 'default', 'default');
139
        $registry->reset();
140
    }
141
}
142