Code Duplication    Length = 16-23 lines in 2 locations

src/PhpGitHooks/Module/PhpUnit/Tests/Behaviour/GuardCoverageToolCommandHandlerTest.php 2 locations

@@ 34-56 (lines=23) @@
31
    /**
32
     * @test
33
     */
34
    public function itShouldShowWarningMessage()
35
    {
36
        $outputMessage = new PreCommitOutputWriter(GuardCoverageTool::CHECKING_MESSAGE);
37
        $currentCoverage = 60.00;
38
        $previousCoverage = 70.00;
39
40
        $this->shouldProcessStrictCoverage($currentCoverage);
41
        $this->shouldWriteOutput($outputMessage->getMessage());
42
        $this->shouldReadGuardCoverage($previousCoverage);
43
        $this->shouldWriteLnOutput(
44
            sprintf(
45
                "\n<bg=yellow;options=bold>%s Previous coverage %s, current coverage %s.</>",
46
                HookQuestions::PHPUNIT_GUARD_COVERAGE_MESSAGE_DEFAULT,
47
                $previousCoverage,
48
                $currentCoverage
49
            )
50
        );
51
        $this->shouldWriteGuardCoverage($currentCoverage);
52
53
        $this->guardCoverageToolCommandHandler->handle(
54
            new GuardCoverageCommand(HookQuestions::PHPUNIT_GUARD_COVERAGE_MESSAGE_DEFAULT)
55
        );
56
    }
57
58
    /**
59
     * @test
@@ 61-76 (lines=16) @@
58
    /**
59
     * @test
60
     */
61
    public function itShouldWorksFine()
62
    {
63
        $outputMessage = new PreCommitOutputWriter(GuardCoverageTool::CHECKING_MESSAGE);
64
        $currentCoverage = 70.00;
65
        $previousCoverage = 60.00;
66
67
        $this->shouldProcessStrictCoverage($currentCoverage);
68
        $this->shouldWriteOutput($outputMessage->getMessage());
69
        $this->shouldReadGuardCoverage($previousCoverage);
70
        $this->shouldWriteLnOutput($outputMessage->getSuccessfulMessage());
71
        $this->shouldWriteGuardCoverage($currentCoverage);
72
73
        $this->guardCoverageToolCommandHandler->handle(
74
            new GuardCoverageCommand(HookQuestions::PHPUNIT_GUARD_COVERAGE_MESSAGE_DEFAULT)
75
        );
76
    }
77
}
78