Code Duplication    Length = 16-19 lines in 2 locations

src/OroCRM/Bundle/ContactUsBundle/Tests/Functional/Fixtures/LoadContactUsBundleFixtures.php 1 location

@@ 61-76 (lines=16) @@
58
    /**
59
     * @return Channel
60
     */
61
    protected function createChannel()
62
    {
63
        $channel = $this
64
            ->factory
65
            ->createBuilder()
66
            ->setName(self::CHANNEL_NAME)
67
            ->setChannelType(self::CHANNEL_TYPE)
68
            ->setStatus(Channel::STATUS_ACTIVE)
69
            ->setOwner($this->em->getRepository('OroOrganizationBundle:Organization')->getFirst())
70
            ->getChannel();
71
72
        $this->em->persist($channel);
73
        $this->em->flush();
74
75
        $this->setReference('default_channel', $channel);
76
    }
77
}
78

src/OroCRM/Bundle/SalesBundle/Tests/Functional/Fixture/LoadSalesBundleFixtures.php 1 location

@@ 220-238 (lines=19) @@
217
    /**
218
     * @return Channel
219
     */
220
    protected function createChannel()
221
    {
222
        $channel = $this
223
            ->factory
224
            ->createBuilder()
225
            ->setName(self::CHANNEL_NAME)
226
            ->setChannelType(self::CHANNEL_TYPE)
227
            ->setStatus(Channel::STATUS_ACTIVE)
228
            ->setOwner($this->organization)
229
            ->setEntities()
230
            ->getChannel();
231
232
        $this->em->persist($channel);
233
        $this->em->flush();
234
235
        $this->setReference('default_channel', $channel);
236
237
        return $this;
238
    }
239
240
    /**
241
     * @return User