Code Duplication    Length = 13-23 lines in 2 locations

Tests/Unit/Migration/Loader/DataFixturesLoaderTest.php 1 location

@@ 25-37 (lines=13) @@
22
    /** @var \PHPUnit_Framework_MockObject_MockObject */
23
    protected $fixtureRepo;
24
25
    protected function setUp()
26
    {
27
        $this->container = $this->getMockForAbstractClass('Symfony\Component\DependencyInjection\ContainerInterface');
28
29
        $this->fixtureRepo = $this->getMockBuilder('Doctrine\ORM\EntityRepository')
30
            ->disableOriginalConstructor()->getMock();
31
        $this->em          = $this->getMockBuilder('Doctrine\ORM\EntityManager')
32
            ->disableOriginalConstructor()->getMock();
33
        $this->em->expects($this->any())->method('getRepository')->with('RdvMigrationBundle:DataFixture')
34
            ->willReturn($this->fixtureRepo);
35
36
        $this->loader = new DataFixturesLoader($this->em, $this->container);
37
    }
38
39
    /**
40
     * @dataProvider getFixturesProvider

Tests/Unit/Migration/Loader/MigrationsLoaderTest.php 1 location

@@ 30-52 (lines=23) @@
27
    /** @var \PHPUnit_Framework_MockObject_MockObject */
28
    protected $connection;
29
30
    protected function setUp()
31
    {
32
        $this->kernel          = $this->getMockBuilder('Symfony\Component\HttpKernel\Kernel')
33
            ->disableOriginalConstructor()
34
            ->getMock();
35
        $this->container       = $this->getMockForAbstractClass(
36
            'Symfony\Component\DependencyInjection\ContainerInterface'
37
        );
38
        $this->eventDispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher')
39
            ->disableOriginalConstructor()
40
            ->getMock();
41
42
        $this->connection = $this->getMockBuilder('Doctrine\DBAL\Connection')
43
            ->disableOriginalConstructor()
44
            ->getMock();
45
46
        $this->loader = new MigrationsLoader(
47
            $this->kernel,
48
            $this->connection,
49
            $this->container,
50
            $this->eventDispatcher
51
        );
52
    }
53
54
    /**
55
     * @dataProvider getMigrationsProvider