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

PreCommitTest::testExecute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 14
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 14
loc 14
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
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\Hook;
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 View Code Duplication
class PreCommitTest extends \PHPUnit_Framework_TestCase
0 ignored issues
show
Duplication introduced by
This class 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...
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