Code Duplication    Length = 20-24 lines in 3 locations

tests/CaptainHook/Console/Command/Hook/CommitMsgTest.php 1 location

@@ 17-40 (lines=24) @@
14
use Symfony\Component\Console\Input\ArrayInput;
15
use Symfony\Component\Console\Tests\Fixtures\DummyOutput;
16
17
class CommitMsgTest extends \PHPUnit_Framework_TestCase
18
{
19
    /**
20
     * Tests CommitMsg::run
21
     */
22
    public function testExecute()
23
    {
24
        $repo = new DummyRepo();
25
        $repo->setup();
26
27
        $cmd    = new CommitMsg(HMU_PATH_FILES . '/config/valid.json', $repo->getPath());
28
        $output = new DummyOutput();
29
        $input  = new ArrayInput(
30
            [
31
                'file' => HMU_PATH_FILES . '/git/message/valid.txt'
32
            ]
33
        );
34
35
        $cmd->setIO(new NullIO());
36
        $cmd->run($input, $output);
37
38
        $repo->cleanup();
39
    }
40
}
41

tests/CaptainHook/Console/Command/Hook/PreCommitTest.php 1 location

@@ 17-36 (lines=20) @@
14
use Symfony\Component\Console\Input\ArrayInput;
15
use Symfony\Component\Console\Tests\Fixtures\DummyOutput;
16
17
class PreCommitTest extends \PHPUnit_Framework_TestCase
18
{
19
    /**
20
     * Tests CommitMsg::run
21
     */
22
    public function testExecute()
23
    {
24
        $repo = new DummyRepo();
25
        $repo->setup();
26
27
        $cmd    = new PreCommit(HMU_PATH_FILES . '/config/empty.json', $repo->getPath());
28
        $output = new DummyOutput();
29
        $input  = new ArrayInput([]);
30
31
        $cmd->setIO(new NullIO());
32
        $cmd->run($input, $output);
33
34
        $repo->cleanup();
35
    }
36
}
37

tests/CaptainHook/Console/Command/Hook/PrePushTest.php 1 location

@@ 17-36 (lines=20) @@
14
use Symfony\Component\Console\Input\ArrayInput;
15
use Symfony\Component\Console\Tests\Fixtures\DummyOutput;
16
17
class PrePushTest extends \PHPUnit_Framework_TestCase
18
{
19
    /**
20
     * Tests CommitMsg::run
21
     */
22
    public function testExecute()
23
    {
24
        $repo = new DummyRepo();
25
        $repo->setup();
26
27
        $cmd    = new PrePush(HMU_PATH_FILES . '/config/empty.json', $repo->getPath());
28
        $output = new DummyOutput();
29
        $input  = new ArrayInput([]);
30
31
        $cmd->setIO(new NullIO());
32
        $cmd->run($input, $output);
33
34
        $repo->cleanup();
35
    }
36
}
37