Code Duplication    Length = 19-19 lines in 2 locations

src/Kunstmaan/FormBundle/Tests/unit/AdminList/FormPageAdminListConfiguratorTest.php 1 location

@@ 44-62 (lines=19) @@
41
    /**
42
     * @return \Doctrine\ORM\EntityManager
43
     */
44
    protected function getMockedEntityManager()
45
    {
46
        $configuration = $this->createMock(Configuration::class);
47
        $configuration->method('getQuoteStrategy')->willReturn(null);
48
49
        $repository = $this->createMock(EntityRepository::class);
50
        $repository->method('find')->willReturn(null);
51
        $repository->method('findBy')->willReturn(null);
52
        $repository->method('findOneBy')->willReturn(null);
53
54
        $emMock = $this->createMock(EntityManager::class);
55
        $emMock->method('getRepository')->willReturn($repository);
56
        $emMock->method('getClassMetaData')->willReturn((object) ['name' => 'aClass']);
57
        $emMock->method('getConfiguration')->willReturn($configuration);
58
        $emMock->method('persist')->willReturn(null);
59
        $emMock->method('flush')->willReturn(null);
60
61
        return $emMock;
62
    }
63
64
    public function testAdaptQueryBuilder()
65
    {

src/Kunstmaan/FormBundle/Tests/unit/AdminList/FormSubmissionAdminListConfiguratorTest.php 1 location

@@ 43-61 (lines=19) @@
40
    /**
41
     * @return \Doctrine\ORM\EntityManager
42
     */
43
    protected function getMockedEntityManager()
44
    {
45
        $configuration = $this->createMock(Configuration::class);
46
        $configuration->method('getQuoteStrategy')->willReturn(null);
47
48
        $repository = $this->createMock(EntityRepository::class);
49
        $repository->method('find')->willReturn(null);
50
        $repository->method('findBy')->willReturn(null);
51
        $repository->method('findOneBy')->willReturn(null);
52
53
        $emMock = $this->createMock(EntityManager::class);
54
        $emMock->method('getRepository')->willReturn($repository);
55
        $emMock->method('getClassMetaData')->willReturn((object) ['name' => 'aClass']);
56
        $emMock->method('getConfiguration')->willReturn($configuration);
57
        $emMock->method('persist')->willReturn(null);
58
        $emMock->method('flush')->willReturn(null);
59
60
        return $emMock;
61
    }
62
63
    public function testAdaptQueryBuilder()
64
    {