Passed
Push — master ( 813fe9...62056b )
by Sebastian
06:01
created

RunTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 71.43 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 4
dl 15
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testExecute() 15 15 1

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 CaptainHook\App\Console\Command;
11
12
use CaptainHook\App\Console\IO\NullIO;
13
use CaptainHook\App\Git\DummyRepo;
14
use Symfony\Component\Console\Input\ArrayInput;
15
use Symfony\Component\Console\Tests\Fixtures\DummyOutput;
16
17
class RunTest extends \PHPUnit_Framework_TestCase
18
{
19
    /**
20
     * Tests Run::run
21
     */
22 View Code Duplication
    public function testExecute()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23
    {
24
        $run    = new Run();
25
        $output = new DummyOutput();
26
        $input  = new ArrayInput(
27
            [
28
                'hook'            => 'pre-push',
29
                '--configuration' => HMU_PATH_FILES . '/config/valid.json',
30
                '--message'       => HMU_PATH_FILES . '/git/message/valid.txt'
31
            ]
32
        );
33
34
        $run->setIO(new NullIO());
35
        $run->run($input, $output);
36
    }
37
}
38