Code Duplication    Length = 10-17 lines in 4 locations

src/Starkerxp/CampaignBundle/Tests/Manager/CampaignTargetManagerTest.php 1 location

@@ 63-78 (lines=16) @@
60
     * @group cible
61
     * @group manager
62
     */
63
    public function testUpdateCampaignTarget()
64
    {
65
        $this->loadFixtureFiles(
66
            [
67
                '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml',
68
69
                '@StarkerxpCampaignBundle/Tests/DataFixtures/CampaignManager/CampaignManager.yml',
70
                '@StarkerxpCampaignBundle/Tests/DataFixtures/CampaignTargetManager/DefaultCampaignTarget.yml',
71
            ]
72
        );
73
        $criteria = ['createdAt' => new \DateTime("2016-08-05 12:12:12")];
74
        $cible = $this->manager->findOneBy($criteria);
75
        $this->manager->update($cible);
76
        $ciblePostUpdate = $this->manager->findOneBy($criteria);
77
        $this->assertNotEmpty($ciblePostUpdate->getUpdatedAt());
78
    }
79
80
}
81

src/Starkerxp/CampaignBundle/Tests/Manager/EventManagerTest.php 1 location

@@ 67-83 (lines=17) @@
64
     * @group event
65
     * @group manager
66
     */
67
    public function testUpdateEvent()
68
    {
69
        $this->loadFixtureFiles(
70
            [
71
                '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml',
72
73
                '@StarkerxpCampaignBundle/Tests/DataFixtures/CampaignManager/DefaultCampaign.yml',
74
                '@StarkerxpCampaignBundle/Tests/DataFixtures/TemplateManager/TemplateManager.yml',
75
                '@StarkerxpCampaignBundle/Tests/DataFixtures/EventManager/DefaultEvent.yml',
76
            ]
77
        );
78
        $criteria = ['createdAt' => new \DateTime("2016-08-05 12:12:12")];
79
        $event = $this->manager->findOneBy($criteria);
80
        $this->manager->update($event);
81
        $eventPostUpdate = $this->manager->findOneBy($criteria);
82
        $this->assertNotEmpty($eventPostUpdate->getUpdatedAt());
83
    }
84
85
}
86

src/Starkerxp/LeadBundle/Tests/Manager/LeadManagerTest.php 1 location

@@ 62-77 (lines=16) @@
59
     * @group lead
60
     * @group manager
61
     */
62
    public function testUpdateLead()
63
    {
64
        $this->loadFixtureFiles(
65
            [
66
                '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml',
67
68
                '@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/DefaultLead.yml',
69
            ]
70
        );
71
        $criteria = ['createdAt' => new \DateTime("2016-08-05 12:12:12")];
72
        $lead = $this->manager->findOneBy($criteria);
73
        $this->manager->update($lead);
74
        $leadPostUpdate = $this->manager->findOneBy($criteria);
75
        $this->assertEquals("validatemy.com", $leadPostUpdate->getOrigin());
76
        $this->assertNotEmpty($leadPostUpdate->getUpdatedAt());
77
    }
78
79
}
80

src/Starkerxp/UserBundle/Tests/Manager/UserManagerTest.php 1 location

@@ 48-57 (lines=10) @@
45
     * @group user
46
     * @group manager
47
     */
48
    public function testUpdateUser()
49
    {
50
        $this->loadFixtureFiles(['@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml',]);
51
        $criteria = ['createdAt' => new \DateTime("2017-05-20 00:31:47")];
52
        /** @var User $user */
53
        $user = $this->manager->findOneBy($criteria);
54
        $this->manager->update($user);
55
        $userPostUpdate = $this->manager->findOneBy($criteria);
56
        $this->assertNotEmpty($userPostUpdate->getUpdatedAt());
57
    }
58
59
}
60