Code Duplication    Length = 13-13 lines in 2 locations

src/Badger/Bundle/GameBundle/Tests/Controller/BadgeControllerTest.php 2 locations

@@ 37-49 (lines=13) @@
34
        $this->assertCount($count -= 1, $this->get('badger.game.repository.badge')->findAll());
35
    }
36
37
    public function testDeleteWhenBadgeHasBeenClaimed()
38
    {
39
        $client = $this->createUser();
40
41
        $countBadge = count($this->get('badger.game.repository.badge')->findAll());
42
        $countClaimedBadge = count($this->get('badger.game.repository.badge_completion')->findAll());
43
44
        $badge = $this->get('badger.game.repository.badge')->findOneBy(['title' => 'Bug Hunter']);
45
        $this->deleteBadge($client, $badge->getId());
46
47
        $this->assertCount($countBadge -= 1, $this->get('badger.game.repository.badge')->findAll(), 'Badge is removed');
48
        $this->assertCount($countClaimedBadge -= 1, $this->get('badger.game.repository.badge_completion')->findAll(), 'Claimed badge completion is removed');
49
    }
50
51
    public function testDeleteWhenBadgeHasBeenUnlocked()
52
    {
@@ 51-63 (lines=13) @@
48
        $this->assertCount($countClaimedBadge -= 1, $this->get('badger.game.repository.badge_completion')->findAll(), 'Claimed badge completion is removed');
49
    }
50
51
    public function testDeleteWhenBadgeHasBeenUnlocked()
52
    {
53
        $client = $this->createUser();
54
55
        $countBadge = count($this->get('badger.game.repository.badge')->findAll());
56
        $countUnlockedBadge = count($this->get('badger.game.repository.badge_completion')->findAll());
57
58
        $badge = $this->get('badger.game.repository.badge')->findOneBy(['title' => 'Bug Hunter']);
59
        $this->deleteBadge($client, $badge->getId());
60
61
        $this->assertCount($countBadge -= 1, $this->get('badger.game.repository.badge')->findAll(), 'Badge is removed');
62
        $this->assertCount($countUnlockedBadge -= 1, $this->get('badger.game.repository.badge_completion')->findAll(), 'Badge completion is removed');
63
    }
64
65
    /**
66
     * @param Client $client