Passed
Push — master ( 21c505...12ca40 )
by Sebastian
02:34
created

PrePushTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 5
dl 20
loc 20
c 0
b 0
f 0
rs 10

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * This file is part of CaptainHook.
4
 *
5
 * (c) Sebastian Feldmann <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace sebastianfeldmann\CaptainHook\Console\Command\Hook;
11
12
use sebastianfeldmann\CaptainHook\Console\IO\NullIO;
13
use sebastianfeldmann\CaptainHook\Git\DummyRepo;
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