Code Duplication    Length = 10-12 lines in 2 locations

src/OroCRM/Bundle/ContactBundle/Tests/Functional/ImportExportTest.php 1 location

@@ 38-47 (lines=10) @@
35
     *   $this->getContainer()->get('akeneo_batch.job_repository')->getJobManager()->getConnection()->clear();
36
     * if you don't use controller
37
     */
38
    protected function tearDown()
39
    {
40
        // clear DB from separate connection, close to avoid connection limit and memory leak
41
        $batchJobManager = $this->getBatchJobManager();
42
        $batchJobManager->createQuery('DELETE AkeneoBatchBundle:JobInstance')->execute();
43
        $batchJobManager->createQuery('DELETE AkeneoBatchBundle:JobExecution')->execute();
44
        $batchJobManager->createQuery('DELETE AkeneoBatchBundle:StepExecution')->execute();
45
46
        parent::tearDown();
47
    }
48
49
    /**
50
     * @return \Doctrine\ORM\EntityManager

src/OroCRM/Bundle/ContactBundle/Tests/Functional/ImportReplaceOrAddStrategyTest.php 1 location

@@ 48-59 (lines=12) @@
45
     *   $this->getContainer()->get('akeneo_batch.job_repository')->getJobManager()->getConnection()->clear();
46
     * if you don't use controller
47
     */
48
    protected function tearDown()
49
    {
50
        // clear DB from separate connection, close to avoid connection limit and memory leak
51
        $batchJobManager = $this->getBatchJobManager();
52
        $batchJobManager->createQuery('DELETE AkeneoBatchBundle:JobInstance')->execute();
53
        $batchJobManager->createQuery('DELETE AkeneoBatchBundle:JobExecution')->execute();
54
        $batchJobManager->createQuery('DELETE AkeneoBatchBundle:StepExecution')->execute();
55
56
        unset($this->file);
57
58
        parent::tearDown();
59
    }
60
61
    /**
62
     * Test how import contact replace strategy. More see CRM-8363